跳到内容

Infovarious Table No Auto Ads

v1.0.0

infovarious · 2026年10月31日 上架

Automatically wraps tables in your posts with the "google-anno-skip" class so Google AdSense ad intents are not shown inside tables.

正在使用
10 以下
评分
暂无
累计下载
378
最近更新
2026年10月31日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+

贡献者

Google AdSense “ad intents” can turn words inside your content into links, or show chips, that open a dialog with related ads. When this happens inside a table, the result can overlap or break the layout of the table.

Google documents a class named google-anno-skip that excludes a section of a page from ad intents. This plugin adds that class for you: it automatically wraps every table in your post content with a div element, so you do not have to edit each post by hand.

What it does

  • Wraps each table in post content with <div class="no-auto-ads google-anno-skip">.
  • Handles nested tables (only the outermost table is wrapped).
  • Leaves a table alone if it is already wrapped by an element that has the google-anno-skip class.
  • Does not run in the admin area, in feeds, or in embeds.
  • Has no settings screen, loads no scripts or styles, makes no external requests and stores no data.

What it does not do

  • It does not guarantee that no ads will ever appear near a table. It only adds the exclusion class documented by Google for ad intents. Other ad formats (for example in-page auto ads) are controlled in your AdSense account.
  • It does not change your AdSense account or settings.
  • It only affects content output through the the_content filter. Tables printed by a theme template outside the post content are not changed.

Customization

You can change the class names with the tnaa_wrapper_class filter. Keep google-anno-skip in the list, otherwise AdSense will not exclude the area.

add_filter( 'tnaa_wrapper_class', function ( $classes ) { return $classes . ' my-extra-class'; } );

Disclaimer

This plugin is not affiliated with, endorsed by, or sponsored by Google. “Google” and “AdSense” are trademarks of Google LLC.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums