How to prevent PHP scraping of a website by adding blank spaces in your code?

How to prevent PHP scraping of a website by adding blank spaces in your code?

Here is the code, just an image. You can find the actual code in this .txt file.

How does it work and what it does?

This php code will add random html blank spaces, making the scraping a little bit harder to do.

A scrapper usually goes by a pattern. He detects and steals the content between some HTML lines. If the lines have random blank spaces, it will get harder for the scrapper to get the content.

You can add those random blank spaces by adding ‘.$scrapper_array[rand(0, count($scrapper_array) – 1)].’ anywhere on your page (in an echo, obviously).

If you don’t understand or you need more help, leave in the comments.

Add a comment: