Home > Article > CMS Tutorial > How to prevent wordpress from being collected
Many people may have encountered the situation where the content of their own websites has been maliciously collected, especially new sites, original sites, and articles that they have worked hard to write, but have been maliciously collected by others. Because I am a new website, the weight is not high, and the weight of other people's websites is high. It has been included in other people's websites, and it has a good ranking. The content on my website may not have been included yet.
#If this is the case, then search engines may judge that our website is collected from others, which is very unfair. Faced with such a problem, let’s learn how WordPress prevents articles from being maliciously collected.
Then I will introduce two methods to prevent malicious collection:
The first method:
We can turn off some of the feed subscription functions that come with wordpress. As we all know, wp has some built-in rss subscription functions, and most people will choose to use feedsky and other media for burning, so this function that comes with wordpress can It can be closed.
Then how to turn off this function? The specific operation is: open the background-appearance-edit-open the functions.php file, and then copy the following code into it:
/关闭订阅 function disable_our_feeds() { wp_die( __(‘Error: No RSS Feed Available, Please visit our homepage.’));} add_action(‘do_feed’, ‘disable_our_feeds’, 1); add_action(‘do_feed_rdf’, ‘disable_our_feeds’, 1); add_action(‘do_feed_rss’, ‘disable_our_feeds’, 1); add_action(‘do_feed_rss2′, ‘disable_our_feeds’, 1); add_action(‘do_feed_atom’, ‘disable_our_feeds’, 1);
Copy After that, we can enter http://domain name/feed to check whether the subscription function has been turned off.
The second method:
This method is to prevent the right-click copy function and is generally not recommended for everyone to use. There are currently some methods to crack this anti-copying function, and anyone with a little basic knowledge should be able to do it, because doing so may not be friendly to readers, especially some original technical blog posts, which will obviously lose a lot of money. Some viewers, so everyone should consider carefully before adopting this method.
But I still want to share this technology with everyone. The specific method is to add the following code to the bottom of the theme file footer.php:
<script type=”text/Javascript”> <!– document.oncontextmenu=function(e){return false;}; document.onselectstart=function(e){return false;}; //–> </script> <style> body{ -moz-user-select:none; } </style> <SCRIPT LANGUAGE=javascript><!– if (top.location != self.location)top.location=self.location; //–></SCRIPT> <noscript><iframe src=*.html></iframe></noscript>
More wordpress related technical articles, Please visit the wordpress tutorial column to learn!
The above is the detailed content of How to prevent wordpress from being collected. For more information, please follow other related articles on the PHP Chinese website!