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?
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:
to:
Lastly add this filter function to your theme’s functions.php file:
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.