Using ShortPixel Image Optimizer with Cloudflare's API Token

ShortPixel Image Optimizer allows you to use the secure Cloudflare API Token on its settings instead of the Global API Key and Cloudflare account e-mail. This integration will allow our plugin to update your images on Cloudflare as soon as they are optimized so that Cloudflare will never serve unoptimized images.

To create a Token that is suited for this, you need to grant it the "Cache Purge" permission. Follow the instructions below to create it:

  1. Navigate to your Cloudflare account and go to My Profile on the top right:

  2. Select API Tokens in the left section menu and then press the Create Token button:

  3. Choose Create Custom Token (no need to select a template)

  4. Give the Token an internal descriptive name and select "Zone", "Cache Purge" and "Purge" in the three selectors below.

    If you see " Edit" instead of " Purge", it's also valid.

  5. Select a Specific Zone and choose your domain name:

  6. Press the Continue to summary button and then Create Token:

  7. Copy the Token displayed. Save it in a safe place because it's not going to be shown again!

  8. Paste the token code in our plugin settings ( Settings > ShortPixel > Cloudflare API > Cloudflare Token). That's all! :-)

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us