✨ Professional WordPress development, custom website builder, efficient on-line, cooperate and enjoy optimization services! 🚀
To prevent the site from being malicious collection, then you need to understand most of the collection methods and rules, so that you can do the opposite of shielding and anti-acquisition, sometimes we work hard to write some of the articles or a large number of article content to become someone else's dowry, while others collect but also increase the burden on the server, think about it is not worth it ah.
The reason why I decided to do this anti-acquisition idea for a long time, because some time ago there is a website constantly changing IP to collect our Q&A content, I disable an IP, he changed an IP, I later blocked all the IP segments in that area, which is basically to the end. I'm too busy to spend all my time looking at server IPs and blocking IPs every day, right?
So finally made up his mind to do this thing, previously wanted to randomize the content of the WordPress text to insert the words of the site's name, and then hidden through the internal chain style, but so that others can still be captured in the content of the past, so there is a delay in doing so, and then suddenly reacted to the collection of the most important is the collection of the rules, and want to better capture the need to get to the list of articles, and the list of articles. This is now very good to do.
Simply to popularize, the collection of most people are based on the article columns and lists to get the collection of article URL links, so the most important thing is to turn the page, which is almost all the site to expose all the articles of the site in a way, then the simplest solution is to make the site list can not be endless page, so that even if you can collect dozens of content, but also can not be the entire station's content have been collected away.
If you need to specify the ID classification you can modify it like this
Tutorial expansion, this do the task of customer website paging, recorded, you can ignore this code.
If the current category is the specified category, only pagination from 1 to 10 is displayed.
Copy the above code and put it into the functions.php file of the current theme, then you can realize that the 404 page of the WordPress theme will be called when the WordPress page exceeds 10 pages, and you can customize the number of pages by modifying the value of the paged parameter of the code.
The code will take effect on all list pages, home page, article archive (category, tag, date), search page, etc. are treated equally, you can also add judgments according to their own needs, according to different lists to do different restrictions, here will not expand the share.
Also if your translation is using get_next_posts_link(string $label=null, int $max_page) to page the next page, you can also set the max page to avoid a page-flipping dead link.
Don't look at the above lines of code, in fact, the 404 page that the whole paragraph can be used directly to jump to the home page, or even directly use die end, I share here just for the sake of the beautiful end of the 404 page only.
If in order to better prevent WordPress is collected, then you can also feed, sitemap sitemap, etc. to do shielding, because WordPress page turnover page parameters so you can also server shield path way. So that the collection can not get a complete list of links to the site can basically prevent a large part of the collection.
As we WordPress exchange group people are asking about specific columns custom shield page how to do, so it will come back to a little bit of trimming, a little code in the number of "10" is customizable, according to the back of the notes can be modified.
Well, the above is for WordPress anti-gathering to provide a piece of code, I feel the most practical and best way to prevent the collection of ideas and solutions. If you encounter website problems, you need secondary development can contact us. WeChat: wxmbxzb