WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The default WordPress insert/edit link inspector window has options for URL, Target, Title and Class. I would like to add a checkbox labeled "Make link nofollow" that, when checked, adds rel="nofollow" to the link.

It would also need to know if the link already has nofollow and default to checked in the case of a link edit.

Is there an existing filter or action to hook into this dialog to add the required bits?

share|improve this question
unfortunately there are no hooks in those sections. this is something many of us want... – onetrickpony Jan 20 '11 at 22:35
@OTP: Perhaps with 3.1's new link inspector, can we hook now? – Scott B Mar 12 '11 at 20:10
up vote 1 down vote accepted

You could add the advlink plugin in to tinyMCE. I don't think I can attach the code, so to do it you'll need to download a copy of tinyMCE:


Then copy over the advlink directory (from the plugins folder) to your Wordpress plugins folder, and open up the link.htm file.

In there edit the 4 script tags at the top from:

    <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>


    <script type="text/javascript" src="../../../wp-includes/js/tinymce/tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../../wp-includes/js/tinymce/utils/mctabs.js"></script>
<script type="text/javascript" src="../../../wp-includes/js/tinymce/utils/form_utils.js"></script>
<script type="text/javascript" src="../../../wp-includes/js/tinymce/utils/validate.js"></script>

Lastly add this filter function to your theme's functions.php file:

function tiny_mce_advlink($plugins) {
   $newPlugins=array('advlink' => WP_PLUGIN_URL.'/advlink/editor_plugin.js' );
   return $plugins+$newPlugins;
add_filter('mce_external_plugins', 'tiny_mce_advlink');

Then you should have a more advanced dialog when you click on a link. In the Advanced tab you'll notice a drop down that says 'Relationship page to target' and you can select the 'No Follow' option.

You can of course use this tinyMCE plugin as the basis to write your own if you wanted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.