# WordPress

Source: https://docs.ezoic.com/docs/ezoicads/platforms/wordpress/


On WordPress, the Ezoic plugin adds the header scripts and ad placeholders for you. You do not need to edit your theme or paste the snippets from the [setup steps](/docs/ezoicads/integration/).

## Step 1: Install the plugin

1. In WordPress, go to **Plugins > Add New**.
2. Search for **Ezoic**, then click **Install** and **Activate**.
3. If the plugin is already installed, update it to the latest version.

## Step 2: Enable JavaScript integration

1. Go to **Settings > Ezoic**.
2. On the **Dashboard** or **Integration** tab, click **Enable JavaScript Integration**.
3. On the **Integration** tab, under **JavaScript Integration Settings**, check:
   - **Auto-insert Scripts**: adds the Ezoic header scripts to every page.
   - **Enable Privacy Scripts**: adds the Ezoic consent (CMP) scripts.
   - **Use WordPress Placeholders**: the plugin inserts ad placeholders into your pages.
4. Save.


If you use a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed Cache and similar), clear its cache after saving. Otherwise visitors keep getting cached pages without the Ezoic scripts.


## Step 3: Adjust ad placements

With **Use WordPress Placeholders** on, the plugin starts with a default set of placements. To change where ads go, open the **Ad Placements** tab and pick an insertion point for each placement (for example, top of page or under the first paragraph).

To keep placement IDs from an earlier Ezoic setup, open **Ad Placements**, click the gear icon, turn on **Enable Placement ID Selection** under **Advanced**, and save. You can then choose the ID for each location.

## Step 4: Set up ads.txt

Go to **Settings > Ezoic > Ads.txt Setup** and turn on Ezoic's ads.txt management. See [ads.txt](/docs/ezoicads/adstxt/) for how to confirm it is served correctly.

## Preview before going live

Add `?ez_js_preview=1` to any page URL, for example `https://example.com/my-post/?ez_js_preview=1`. The plugin then shows that page with JavaScript integration on, using the default settings from Step 2, even if you have not enabled it yet. It also sets a cookie for one hour, so you can click through the site in preview. Use `?ez_js_preview=0` to leave preview early.

If your site still uses Ezoic nameservers or Cloudflare, the same parameter also turns off that integration for the page, so you see exactly what the plugin does on its own.

## Switching from nameserver or Cloudflare integration

1. If Ezoic manages your SSL certificate, install one on your own host first (your host's SSL or Let's Encrypt). Without it, your site shows certificate errors once Ezoic stops serving it.
2. Complete Steps 1 to 4 and check a post, a category page, and your homepage with `?ez_js_preview=1`.
3. Remove the old integration:
   - **Nameservers:** point your nameservers back to your host at your domain registrar.
   - **Cloudflare:** in the Ezoic dashboard, go to **Settings > Site Integration > Cloudflare** and remove it.

## Troubleshooting

**Scripts are not on the page.** Clear your caching plugin and any server or CDN cache, then reload. Check that **Auto-insert Scripts** is on.

**Ads appear twice or in odd spots.** Remove leftover ad code from your theme, widgets, or another ad plugin.

To add your own ad spots in templates or blocks, use the snippet from [Step 3: Ad Placements](/docs/ezoicads/implementation/). The [ShowAds Builder](/docs/ezoicadsadvanced/showads-builder/) generates a snippet with specific sizes or devices.

