Simply open up your theme’s
functions.php file and add the following lines…
Now simply use the new shortcode of
noskim to suppress any post or page content.
[[noskim]This is a line about an iPhone at Dixons. I don't want any of the text to be linked to by Skimlinks[/noskim]]
Skimlinks provide a WordPress plugin that adds the appropriate code to your site. However, you can do this yourself, and improve upon it, by a few further lines added to your
This will add the Skimlinks script to your site’s footer – simply replace
xxxx with your Skimlinks number. Additionally, this script is designed to only allow Skimlinks to be placed on single posts and pages – you can update this depending on your site’s requirements.
Lastly, you probably don’t want Skimlinks to appear on site parts of your site – e.g. the header, footer and sidebar. To suppress this you’ll need to have a bit more coding knowledge – identify the appropriate
DIV that covers each area and add a class of “noskim” to it.
For example, say you have
<div class="footer"> that covers the footer area of your site. If you change this to
<div class="footer noskim"> then this will prevent any Skimlinks from appearing in the footer.
One reply on “How to suppress Skimlinks for some content in WordPress”
Thanks for this post – very helpful.
Just as an FYI, when you copy and paste the code above, it automatically adds your byline “Read more: Development, WordPress : How to suppress Skimlinks for some content in WordPress – Artiss.co.uk” – so when I cut and pasted this into my functions.php file and quickly saved without checking it first, it broke my site! I had to go into my file manager and delete this line before my site would work again.