How can I add a field to make link nofollow to the WordPress Link Inspector Window?

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.

Read More

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

Related posts

Leave a Reply

1 comment

  1. 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:

    http://tinymce.moxiecode.com/download/download.php

    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>
    

    to:

        <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.