web_adsense Shortcode
Place one Google AdSense ad unit using the site's current publisher configuration. The public shortcode tag remains available when the Legacy Page Builder interface is disabled.
Usage
[web_adsense slot="1234567890" format="auto"]
The example slot must be replaced with a real ad unit ID from your account.
Attributes
| Attribute | Default | Accepted values | Purpose |
|---|---|---|---|
slot |
Empty | 1–32 digits | Ad unit identifier; leading zeroes are preserved. This is not the publisher ID. |
format |
auto |
auto, autorelaxed |
Use the format supplied by the account. Invalid values fall back to Auto. |
device_visibility |
Empty | Space-separated web-hide-on-xs, web-hide-on-sm, web-hide-on-md, web-hide-on-lg |
Hide the complete placement, including its spacing, in selected theme device ranges. |
el_id |
Empty | HTML anchor | Optional anchor on the placement wrapper. |
el_class |
Empty | Space-separated CSS classes | Existing helper classes; no CSS is generated. |
Configuration and consent
Enable Settings → POM Theme → Integrations → Google Ads and enter a valid Google Adsense ID (ca-pub- followed by 16 digits). Missing or invalid configuration produces no public ad markup.
The shortcode and AdSense block share their renderer and loader. Units remain in an inert template until consent, visitor interaction and a visible container permit initialization. They use the existing db display helper and web-gap-2 spacing. No per-instance script or stylesheet is added. Automatic post placements use the same behavior.
The optional Ads category in the enabled POM cookie notice controls consent. With that notice disabled, an external consent manager must authorize the shared runtime. Scrolling alone never grants consent. WordPress Preview and editor requests show a passive message and never request ads through this integration.
Read Place an AdSense ad unit for external-CMP integration, AMP requirements, account-controlled Auto ads, revocation behavior and pre-publication verification. The theme loading gate does not replace Google's applicable CMP requirements.
Verification
Confirm IDs, responsive visibility and saved options before publication. On the approved site, check rejection, acceptance and revocation without clicking your own ads. Ad blockers and lack of inventory can leave empty placements. Clear full-page caches after publisher or consent changes.