This is a silly question but I am bit confused. What are the disadvantages of removing HTML tags before indexing the pages?
-
I'm going to give this benefit of the doubt and assume there is a question here. Either way it's probably better off on Webmasters. – Josh K Nov 17 '10 at 19:46
-
2Can you clarify your question a bit? It's hard to understand exactly what you are asking. – John Conde♦ Nov 17 '10 at 20:12
I can think of two good reasons.
By removing all the HTML tags you're removing all the semantics of the text.
This disadvantages any ranking algorithm - all else being equal, a page with "Tree" in a heading is more likely to be about trees than one with "tree" in the text somewhere.You're also discarding attributes that could be used to index.
To illustrate, a link to an image of a tree might have alt text describing the tree. Discard the alt text, and your page might not show up in the search.
It depends on how you remove them. If you use a smart library, like jsoup or tagsoup or neko, you get nothing but benefit. If you use a bad library, it can lose your content for you.
-
Can someone expand on this? Those libraries seem to be HTML parsers. I don't see how their use was benefit search engine indexing. – Lèse majesté Nov 17 '10 at 23:50
-
1By avoiding treating the tags as words in the index. E.g., searching for 'head' – bmargulies Sep 9 '11 at 22:42