News for hackers. Stuff that matters.
Re:Advice for a friend who wants to start a blog by righthand on Thursday January 30, 2025 @10:19AM (#42878552)
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.
Re:Advice for a friend who wants to start a blog by EFreethought on Thursday January 30, 2025 @11:03AM (#42878996)
Is there a way to do that in WordPress on a shared host?
Re:Advice for a friend who wants to start a blog by righthand on Thursday January 30, 2025 @12:25PM (#42879916)
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.