WordPress Theme Website How to prohibit others to embed the framework of your site

Source: Internet
Author: User

So, as the framework of the WordPress webmaster should be how to prevent others to embed the framework?

In fact, to prevent others frame your site is also very simple. Just a simple code can be implemented, the code is as follows:

The code is as follows Copy Code

<script language= "JavaScript" >
if (self!= top) top.location.href = Window.location.href;
</script>

The role of this JS statement: To prevent their own web page by the human frame, Top.location.href is the top of the address, Windows.location.href is its own address. Prevent others from embedding your Web site directly in the following way.

The code is as follows Copy Code

<iframe src= "http://ssmay.com" ></iframe>

This way, even if someone frames your site (such as a theme demo station), the user clicks on the frame link and will really jump to your site. In this way, you can bring direct traffic to your site. If you're in the same situation, try it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.