Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All of these replies say don’t worry about it and just blog but I say detect the IPs and user agents and return a scrambled post. If you’re small enough they probably won’t care to go the extra effort to scrape you.


Is there a way to do that in WordPress on a shared host?


Sure you can hook into Wordpress’ hooks with either:

- `add_action(‘template_redirect’, ‘my_scramble_func’)`

- or `add_filter(‘the_content’, ‘my_scramble_func’)`

Wordpress is PHP so you get the power of doing whatever as the request loads.

`Template_redirect` would allow you to redirect to a specific template/page.

`the_content` would allow you to return different content for that path.

Then you just need to check the user-agent/IP. I’m sure there’s a PHP library you could install with composer to do this.

What would be fun in my opinion is leaving the metadata the same but replacing only the meat. For example article titled “How to Update Your Blog” would still have the title and headings, but then return “<h2>Step one: open your blog editor</h2><p>hajfineidif hahahe lorem ipsum…</p>” for the paragraphs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: