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
    Commented Nov 17, 2010 at 19:46
  • 2
    Can you clarify your question a bit? It's hard to understand exactly what you are asking.
    – John Conde
    Commented Nov 17, 2010 at 20:12

2 Answers 2


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. Commented Nov 17, 2010 at 23:50
  • 1
    By avoiding treating the tags as words in the index. E.g., searching for 'head'
    – bmargulies
    Commented Sep 9, 2011 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.