• Home
  • Blog
  • Contact Us
  • Home
  • Blog
  • Contact Us

Edit the ‘Link’ Button in WordPress

Last Updated: 29 September 2016 By Mike Haydon

I’m sick of having to put rel=”nofollow” and target=”_blank” into every tag when I’m posting (I am currently using WordPress 2.5.1 on my own host). I thought “there’s gotta be an easier way”. There must be a way I can edit the “link” button to add those html attributes automatically… There is.

This is how to edit a button on the WordPress composition panel:

Open the file wp-includes/js/quicktags.js in Wordpad (I don’t know the Mac equivalent). Notepad won’t let you see the file properly because it doesn’t read the line-breaks correctly.

Scroll down to the code where it says:

function edInsertLink(myField, i, defaultValue) {
if (!defaultValue) {
defaultValue = ‘http://’;
}
if (!edCheckOpenTags(i)) {
var URL = prompt(quicktagsL10n.enterURL, defaultValue);
if (URL) {
edButtons[i].tagStart = ‘<a href=”‘ + URL + ‘”>’;
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}

change the line:

edButtons[i].tagStart = ‘<a href=”‘ + URL + ‘”>’;

to read:

edButtons[i].tagStart = ‘<a href=”‘ + URL + ‘ rel=”nofollow” target=”_blank”>’;

save the file (ftp to your site) and you’re done! It’s that simple

Filed Under: Wordpress
Originally Posted: 27 April 2008

Comments

  1. Mike Haydon says

    27 April 2008 at 4:08 pm

    One thing I just noticed… If you are using firefox and this solution doesn’t work for you, you need to clear the cache. Press Ctrl+Shift+Del, make sure “Cache” is selected, then press “Clear Private Data Now”. Refresh the page and this will work.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Web Design

marketing banner

Want to learn how to build your own websites? Check out the course we jointly developed here.

Recent Posts

  • Moving Wordpress Without Plugins
  • Redirection Problem When Installing Wordpress
  • Edit The Default Wordpress RSS Widget
  • Best Wordpress Spam Filtering Plugin
  • Optimize Your Wordpress Site For Mobile
  • Wordpress Delete Post Revisions
  • Add Twitter Follower Count To A Wordpress Page

How Can We Help You?

  • Website Design Service
  • Google Penalty Recovery Service
  • Search Engine Optimization Service

Categories

  • Online Marketing
  • SEO
  • Social Media
  • Website Design
  • Wordpress

At A Glance

  • Ranking
  • Website Design
  • WordPress
  • Social Media
  • Contact
  • Google Penalties
  • Earnings Disclosure
  • Privacy Policy

Contact Us

Local SEO Perth

Contact Us Here

Copyright © 2023