Linux 软件免费装
Banner图

WP Anti-Clickjack

开发者 someguy9
更新时间 2026年10月13日 09:15
捐献地址: 去捐款
PHP版本: 7.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

security clickjacking Browser Frame Breaking Script anti click jacking

下载

1.6.2 1.6.5 1.7.1 1.5.4 1.6.0 1.0.0 1.1.1 1.3.0 1.4.0 1.5.0 1.5.2 1.6.1 1.6.4 1.7.0 1.7.3 1.1.0 1.5.1 1.7.5 1.7.6 1.7.7 1.5.3 1.6.3 1.7.2 1.7.4 1.7.8 1.7.9 1.8 1.8.0

详情介绍:

WP Anti-Clickjack is a powerful security plugin that helps prevent your WordPress site from being vulnerable to clickjacking attacks. Clickjacking is a malicious technique where an attacker tricks users into clicking on a concealed link or button by overlaying it on your legitimate website. This plugin implements two key defense mechanisms:
  1. Frame protection headers: The plugin adds the X-Frame-Options: SAMEORIGIN and Content-Security-Policy: frame-ancestors 'self' HTTP headers to your site's pages. They instruct web browsers to prevent other websites from embedding your site within an iframe, effectively blocking clickjacking attempts. A Content-Security-Policy your site already sends is left in place, and WordPress post embeds stay embeddable on other sites.
  2. OWASP's Legacy Browser Frame Breaking Script: The plugin includes a modified version of OWASP's legacy browser frame breaking script. This script prevents other sites from putting your site in an iframe, even in browsers that don't support the X-Frame-Options header. The script is optimized to work seamlessly in browsers with and without JavaScript enabled.
By combining these two security measures, WP Anti-Clickjack provides comprehensive protection against clickjacking attacks, ensuring the safety and integrity of your WordPress site. For more information about clickjacking defense techniques, refer to the OWASP Clickjacking Defense Cheat Sheet. Features Additional Details To disable the clickjacking JavaScript, use the following filter in your theme's functions.php file. It receives true or false and runs last, so you can also return false only on specific pages: add_filter('wp_anti_clickjack', '__return_false'); To disable the clickjacking HTTP headers (X-Frame-Options and Content-Security-Policy: frame-ancestors), use this filter in your theme's functions.php file: add_filter('wp_anti_clickjack_x_frame_options_header', '__return_false'); To let other sites put your site in a frame, add them under Settings > Anti-Clickjack, one per line. Developers can use this filter instead (it also receives the sites saved in the settings). Wildcards work for subdomains, and the frame breaking script allows the same sites: add_filter( 'wp_anti_clickjack_allowed_origins', function ( $origins ) { $origins[] = 'https://partner.example'; $origins[] = 'https://*.example.com'; return $origins; } ); If your WordPress admin runs on a different domain than your site, that domain is allowed automatically so page builders and previews keep working. Page builder and editor previews are detected only for logged-in users who can edit posts, so a visitor cannot switch the protection off by adding a page builder parameter to a URL. If your server, CDN or another plugin already sends an X-Frame-Options header or a frame-ancestors policy, the plugin leaves them as they are and doesn't add its own.

安装:

  1. Download the plugin from the WordPress.org repository or your WordPress admin dashboard.
  2. Upload the plugin files to the /wp-content/plugins/wp-anti-clickjack directory, or install the plugin through the WordPress admin interface.
  3. Activate the plugin through the 'Plugins' screen in your WordPress admin.
  4. The plugin will automatically add the necessary anti-clickjacking measures to your site.

常见问题:

Does this plugin affect my site's performance?

No, WP Anti-Clickjack is designed to have minimal impact on your site's performance. The anti-clickjacking measures are applied efficiently without causing any significant overhead.

Is this plugin compatible with page builders and editors?

Yes, WP Anti-Clickjack is compatible with popular page builders and editors such as Elementor, Divi, WPBakery, Thrive Architect, and more. If you encounter any compatibility issues, please contact me for assistance.

How do I let another site put my site in a frame?

Add its address under Settings > Anti-Clickjack, like https://partner.example (or https://*.example.com for every subdomain). Developers can use the wp_anti_clickjack_allowed_origins filter shown under Additional Details. The site is added to the frame-ancestors policy and the frame breaking script allows it too.

How do I know the protection reaches my visitors?

Go to Tools > Site Health. The plugin's check loads your homepage the way a visitor would and tells you if the headers are missing (often a page cache or CDN serving pages without them) or if more than one framing policy is sent. Click "Check from outside" there or under Settings > Anti-Clickjack to have ClickJack Test load your homepage from the internet, through any CDN or proxy, and show what it sees.

Can I customize the anti-clickjacking behavior?

Yes, the plugin provides filters that allow you to disable the clickjacking JavaScript and the X-Frame-Options header when needed. You can use these filters in your theme's functions.php file to fine-tune the plugin's behavior.

更新日志:

1.9.0 1.8.0 1.7.9 1.7.8 1.7.7 1.7.6 1.7.5 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.0 1.3.0 1.2.0 1.1.1 1.1 1.0