How difficult would it be to add an option for “nofollow” to the Link editor’s existing “Link Relationship(XFN) options list?
Alternately, or better yet, in addition, add an item to the “Bulk Actions” listing called “Make links no follow” that would make all selected links rel=”nofollow”.
I’d like to add this feature to my theme’s functions.php
Alternatively you can undo the code that disables the relationship box by re-pointing the enqueue to the xfn.js script..
First create a modified version of that script, like so..
Save as xfn.js and place into a plugin’s folder or the current theme’s folder.
NOTE: It’s a direct copy of the original(existing) script enqueued by WordPress, i’ve left original code that sets the rel input to read-only so you can see what’s been changed(one line).
Then add this to your plugin code, or theme’s functions.php, and uncomment the appropriate line in the code sample..
Job done… 🙂
I’m not sure there’s a filter or action in there. If so, reasonably easy. If not, use my External Links plugin:
http://wordpress.org/extend/plugins/sem-external-links/
Here’s a function which removes the existing link_xfn meta box, and adds another identical one with a checkbox for “nofollow”:
A lot of copypasta from core, but its better than a hack. You of course are free to change the xfn options in any way you want.
It’s already in there. You only need to deactivate javascript in your browser and reload the page. You can now enter freely
nofollow
.If you ask yourself why I know that: The related ticket is #14599: Link Manager does not support nofollow in Link Relationship (XFN)