sethson.com - an article blog about almost everything



Super Version of the SH-Autolink Plugin for Wordpress

The Wordpress plugin SH-Autolink is pure gold if you, like me, hate setting up internal linking on your website. The plugin automatically transforms specific words into links, so you don’t have to worry about doing it yourself. Excellent if you have hundreds of posts that you no longer remember, potential affiliate links that you always forget about, etc.

I use SH-Autolink here on sethson.com, but I had a few problems with it when I started out:

  • The plugin transform all occurrences of the words you have specified, not just the first occurrence of each word in a post. That means a lot of links if you write about ‘mountain bikes’ and have specified ‘bikes’ as a word that must be transformed.
  • The plugin transform subheaders if your specified words occur there. That means ugly headers that will hurt yours eyes.

New Functionality

I couldn’t live with that, so I decided to modify the plugin and make a slightly better version. My modified version does the following in addition to the normal SH-Autolink functionality:

  • It only transforms the first occurrence of each specified word in a post.
  • It doesn’t transform words in subheaders (H2 tags in my world, but you can easily modify the code if subheaders are for example H3 in your world).
  • It automatically transforms the singular form of the words if the plural form can’t be found in the post (still only first occurrence of each specified word and only if the plural form is specified and ends with an ‘s’).
  • It allows alternative words (words that must be transformed if the normal words can’t be found in the post).
  • It doesn’t convert words in pages, only in posts. You can comment out one line of code if you want to convert words in both pages and posts.

Download SH-Autolink Super

You can download my version of the SH-Autolink plugin here (zip-file, version 0.01 beta). I have named it SH-Autolink Super…

My version is based on SH-Autolink 0.94 Beta and it also comes with the GPL license.

Feel free to write your feelings about SH-Autolink and SH-Autolink Super below.



23 comments on “Super Version of the SH-Autolink Plugin for Wordpress”

  1. zakopiec skriver:

    I want use in MU Wordpress, but not working. Can I use only wordpress single?

  2. admin skriver:

    I haven’t tested it with MU, so I don’t really know if it only works with the normal Wordpress.

  3. Mircea skriver:

    I had sh-autolink previously installed and when i try your plugin i get in the posts WordPress database error: [Unknown column 'altkeyword' in 'field list']
    SELECT id, url, keyword, altkeyword, protocol, target FROM wp_shautolink …also the manage page is the same as in 0.94, no altkw

  4. Brian skriver:

    The manage page is the same, it didn’t change that one (I use SQLyog instead, it gives direct table access and is much faster to use).

  5. Nuno Krold skriver:

    Great idea Brian,
    How can I exclude other tags like to be converted in pages? An entire class or id?
    I tried to apply a H2 to the text I don’t want to be converted in pages in my sidebar, but it didn’t work. example: Text not be coverted in pages

    Thanks

  6. Brian skriver:

    Hi Nuno,

    It only works for the page/post text itself, not text in the sidebar.

    You can change the source code if you want to exclude other tags.

  7. Puneet Aggarwal skriver:

    The Ninja Affiliate Linker is a much better plugin with far more features. You can get it at : http://herbscancure.com/blog/ninjatool
    A must-have for all kinds of affiliates.

  8. Brian skriver:

    Maybe. I haven’t tried it since my plugin is free and Ninja Affiliate Linker cost $127 :(

  9. Tony Parra skriver:

    Hi, brian i tried your plugin and i get this error message im a newbie when it come to coding so can you help?

    Warning: Wrong parameter count for preg_replace() in /home/bl4xxx/public_html/phatbuttmovies/blog/wp-content/plugins/sh-autolink-super.php on line 152

  10. Brian skriver:

    Hi Tony,

    What version of WP are you using?

  11. Santiago skriver:

    Hi Brian

    I have install your SH-autolink-super
    but not runs

    I have WP 2.6.2
    you can check at
    http://www.2.4ghz.es

    Thanks for you help
    Santiago

  12. Gene skriver:

    Hey,

    I’ve started working with the plug in but have run into a problem. When I try to edit or delete a keyword it says it can’t find sh-autolink.php. I went in and changed it to sh-autolink-super.php but that only changed the reported missing file.

    Any suggestions?

  13. Andy skriver:

    Thanks for producing this plugin, I’d been looking around for something like this for ages (that didn’t cost $100!). I’ve just downloaded it now, fingers crossed I don’t have any of the problems other people have had.

  14. lisa skriver:

    I like what it does but if I want to delete a keyword that I set up it gives me a 500 Server Error after I press delete and it doesnt go away, thoughts

  15. Money Ideas skriver:

    I love this plug in! Thank you.

  16. compare.com skriver:

    This dude is a total idiot, he made a plugin and distributed it all over the web, and he didnt evne test it, don’t bother downloading its totally screwed!

  17. Mick skriver:

    compare.com, you are the idiot here. This plugin works great! Thanks

  18. Matt skriver:

    I’m having trouble with the plugin. I installed it properly but I don’t understand how to use it? There’s no option or forms to tell it what words to link in the plugins area or anything. Where do I Go?

    Sorry for beng a noob.

  19. Matt skriver:

    Nevermind lol!

  20. Markus skriver:

    If you are upgrading from the original SH-Autolink, you must delete the shautolink table first, because sh-autolink-super uses different colums which will cause errors otherwise …

  21. ultras tei skriver:

    Hello! Nice work with SH-Autolink Super! I have only one problem:

    1. I have predefined autolink word: “steaua”
    2. If I write in comments “steaua” automatically it will be autolink “steaua”
    3. If I write in comments steaua it will be link “steaua” to http://asd
    4. If I write in body post or page “steaua” automatically it will be autolink “steaua”
    5. If I write in body post or page steaua it will be autolink “steaua” NOT link to http://asd

    How can I do to be in the post or page exactly like into the comments?
    I want into the content of post or page steaua to be link to http://asd, NOT autolink

    Thank you!

  22. Chris G skriver:

    Hello, AM not smart enough to figure out which part of the code to delete in order to auto link in BOTH posts and pages. Please advise… THanks! chris

  23. Oscar skriver:

    Brian, your plugin is great!

    I’ve a problem when I try to edit or delete a keyword, it says it:
    You do not have sufficient permissions to access this page.

    Could you please help me?

    Thank you

Write a comment