MyBB Community Forums

Full Version: Stopping certain words being spidered
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You might have noticed like me that when it comes down to SEO when your site is spidered, that all sorts of odd keywords pop-up as being relevant to your site.

They can be down to common things that are found on near enough every page, especially when running forum software.  
Words like Thread, Post, Mode, vote, unread etc

This isn't particularly useful for your site rankings and really isn't helpful when you want to try and be clearer about what it is your site actually contains which words occur less often.

There hasn't really been much you can do about this, other than logging directly into which every search engine webtools are available and trying to exclude things from there.

Yahoo did create a method where a html tag could have "robots-nocontent" added as a class to omit it from being spidered, however that is only one search engine and really there needs to be something that can cater to all.


The following is one potential solution, which appears to work (although if you find it doesn't feel free to tell me)

Firstly you'll require creating a CSS style.  This would need to either be in <style> tags in the actual HTML page or added to your CSS file.  (In the case of MyBB that's editing or creating a stylesheet for your theme) :
<style>
.x:before{
content:attr(title);
display:inline;
}
</style>
I've used a short class name here of "x" but you could rename it to anything to make sure it doesn't effect/clash with your styles. I'd suggest keeping it short though since it will likely be used quite a bit across a working forum when omitting some information like say "post number".

Let's say you had the following HTML:
<ul>
<li><a href="#">Login</a></li>
<li><a href="#">Logout</a></li>
</ul>

It's possible that a search engine could treat Login and Logout as potential keywords.

<ul>
<li><a href="#"><span class="x" title="Login"></span></a></li>
<li><a href="#"><span class="x" title="Logout"></span></a></li>
</ul>
When changed to use this format however, both Login and Logout can be omitted by the search engine.

What this is basically doing is placing the contents of the Title attribute into place of where the span was, before any value.  Leaving the value null is important as this means should a search engine check the tag for contents in the value it will realise it's empty, likely causing it to skip checking the attributes for data.  
(There is no standard search engine practice for skipping attribute of tags with no values unfortunately, so it might not prove to be 100% effective)

It should be considered that its not recommended to do this directly with an a (anchor) tag Class attribute, as anchors can be used for sitemaps which could well be spidered.  (In fact SEO sites likely suggest including Title tags with different information for links just to increase the variety of keywords used)

<span class="x" title="Login" />
Further more in HTML5 it's possible to negate having the need for a closing tag.

Hopefully now you have a basic understanding of how this method is used and how you an use it with your templates to help reduce useless keywords being counted.
Wow, lots of good information. I will certainly keep this in mind, thank you Smile
Great tutorial, cheers!