> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.wpcompress.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Cloudflare Integration: Full Setup Guide

WP Compress integrates with Cloudflare to provide automated cache purging and uninterrupted access, ensuring your website stays optimized and up to date without manual intervention.

| The API token is set up once at the account level. Once connected, all zones across your Cloudflare account will appear in the WP Compress dropdown — you simply select the site you want to link each time, no additional token setup required. If you'd like to restrict the token to a specific domain only, you can do so during setup.

---

## Step 1: Generate an API Token

1. Log in to [Cloudflare](https://dash.cloudflare.com/)
2. Click your profile icon in the top right and select **My Profile**
3. Navigate to the **API Tokens** tab
4. Click **Create Token**

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/mainfull-3_1pq2gfu.png)

5. Click **Create Custom Token**

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/zight-2025-02-11-at-83024-pm_wsq8k1.png)

---

## Step 2: Configure the API Token

1. Configure the token permissions as shown below

![](https://storage.crisp.chat/users/helpdesk/website/-/4/9/a/2/49a2bcd521bcc400/configure-api-token_kl4jca.png)

2. Save your settings — it should look like this

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/zight-2025-02-11-at-83341-pm_1m0s6zr.png)

| If you'd like to restrict this token to a specific domain rather than your entire account, specify the zone under the Zone Resources section before saving.

3. Copy your token and store it somewhere safe

![](https://storage.crisp.chat/users/helpdesk/website/49a2bcd521bcc400/zight-2025-02-11-at-83451-pm_1gl4jn.png)

||| This is the only time your token will be displayed. Copy it before closing this screen.

---

## Step 3: Connect to WP Compress

1. Navigate to your WP Compress settings
2. Locate the **Cloudflare Integration** section
3. Paste the API token and click **Connect**
4. Select the zone you want to link from the dropdown
5. Click **Connect** — the page will update once the connection is confirmed

Once connected, WP Compress will automatically purge the Cloudflare cache whenever optimizations are applied. To link additional sites, simply return to the Cloudflare Integration section, select a new zone, and connect — no new token needed.

---

## Need Help?

||| If you run into any issues during setup, our support team is available 24/7 via live chat. You can also refer to the [Cloudflare API documentation](https://developers.cloudflare.com/api/) for token configuration details.