Cloaking is a search engine optimization (SEO) technique in which the content presented to the search engine spider is different from that presented to the user's browser. This is done by delivering content based on the IP addresses or the User-Agent HTTP header of the user requesting the page. When a user is identified as a search engine spider, a server-side script delivers a different version of the web page, one that contains content not present on the visible page, or that is present but not searchable. The purpose of cloaking is sometimes to deceive search engines so they display the page when it would not otherwise be displayed (black hat SEO). However, it can also be a functional (though antiquated) technique for informing search engines of content they would not otherwise be able to locate because it is embedded in non-textual containers such as video or certain Adobe Flash components. As of 2006, better methods of accessibility, including progressive enhancement, are available, so cloaking is no longer necessary for regular SEO.
Cloaking is often used as a spamdexing technique to try to trick search engines into giving the relevant site a higher ranking. By the same method, it can also be used to trick search engine users into visiting a site that is substantially different from the search engine description, including delivering pornographic content cloaked within non-pornographic search results.
Cloaking is a form of the doorway page technique.
A similar technique is used on DMOZ web directory, but it differs in several ways from search engine cloaking:
Increasingly, for a page without natural popularity due to compelling or rewarding content to rank well in the search engines, webmasters design pages solely for the search engines. This results in pages with too many keywords and other factors that might be search engine "friendly", but make the pages difficult for actual visitors to consume. As such, black hat SEO practitioners consider cloaking to be an important technique to allow webmasters to split their efforts and separately target the search engine spiders and human visitors. Cloaking allows user experience to be high while satisfying the necessary minimum keyword concentration to rank in a search engine.