Using ShortPixel Image Optimizer with Cloudflare's API Token
Starting with ShortPixel Image Optimizer version 4.15.5, you can now use the more secure Cloudflare API Token in ShortPixel Image Optimizer's settings instead of the Global API Key and Cloudflare account e-mail:
To create a token that is suited for this, you need to grant it the "Cache Purge" permission. These are the steps to create such a token on your Cloudflare account:
- On your Cloudflare account, go to "My Profile" on the top right:
Select "API Tokens" in the top section menu and then press the "Create Token" button:
Choose Custom token (no need to select a template)
Give the Token an internal name and select "Zone", "Cache Purge" and " Purge" ("Edit" is also valid) in the three selectors below.
Select a specific Zone and chose your domain name:
Press "Continue to Summary" and then "Create Token":
Copy the Token displayed. Save it in a safe place because it's not going to be shown again!
Use the token code on ShortPixel's settings. That's all! :-)