thomas
thomas

Reputation: 2308

Odd scenario / hide names from Google crawlers

My client has a blog and wants to hide all mentioned names from Google's crawlers. For this reason he wrote all personal names l.i.k.e t.h.i.s., seperating each letter with a dot. This approach seems to work, but as I am rebuilding his site right now I am looking for ways that still work, but look less shit and are readable. The dotted pattern is easily replaceable with regEx and I have no problem stripping the dots with PHP, but my question is, what should I replace them to?

Thanks for hints and ideas!

Upvotes: -1

Views: 113

Answers (1)

Stephen Ostermiller
Stephen Ostermiller

Reputation: 25524

Anything you write into the page from a JavaScript file that is blocked from crawling with robots.txt won't get indexed by search engines.

file.html

<!doctype html>
<html><head>
<script src=/write_name.js>
</head><body>
Your name is <div id=name1></div>
</body></html>

write_name.js

document.addEventListener("DOMContentLoaded",function(){
    document.getElementById('name1').innerText = "John Doe"
})

robots.txt

User-Agent: *
Disallow: /write_name.js

See Preventing robots from crawling specific part of a page

Upvotes: 2

Related Questions