1

This current article from Wikipedia defines Cloaking as:

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.

If DOM data is same with any CSS tweaks, I can only understand on JavaScript DOM-Mutations for achieving this (because AFAIK Google Crawler doesn't run scripts so the crawler and the user will get different content if DOM-Mutation is immediate after content load).

Am I correct when assuming DOM-Mutations are at the root of each cloaking?

2

Using JavaScript to mutate the DOM would not usually be considered cloaking. These days Googlebot can execute JavaScript and sees pages as they are rendered to users once JavaScript has run.

It would still be a bad idea to put high traffic keywords in the HTML source code and then use JavaScript to overwrite them or remove them. That would be like using keywords in white text on a white background or like using keywords in a font too small for users to see. Those are tricks that Googlebot is now advanced enough not to be fooled by, but if you are trying to use them to fool search engines it shows bad faith and could get your site penalized.

Many legitimate frameworks and JavaScript libraries change the DOM because it makes for good user experience. You shouldn't be afraid to use all JavaScript DOM manipulation because you are afraid of cloaking. It should always be fine to add keywords to the page using JavaScript, or change content on user interaction.

Cloaking is usually caused by changing the content or keywords based on the User-Agent string, showing special content just when the Googlebot user agent is present. See Cloaking - Search Console Help.

  • Thanks. I'll try to read in the linked page though I I get to know "User-Agent string" term for the first time. – JohnDoea May 17 at 20:33
  • 1
    Browsers identify themselves as part of the HTTP request. The User-Agent is a HTTP header sent by most all browsers and crawlers. Googlebot identifies itself like Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html). That user agent string is also available to JavaScript as navigator.userAgent. – Stephen Ostermiller May 17 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.