Custom error page - How to insert error tokens on Wordpress

Hi,

On a Wordpress installation how to apply the tokens described here : https://support.cloudflare.com/hc/en-us/articles/200172706-Configuring-Custom-Pages-Error-and-Challenge-

I’ve seen :

<html>
<head></head>
 <body>
   ::[REPLACE WITH CUSTOM ERROR TOKEN NAME]::
 </body>
</html>

But… how to do it properly in WP ?

Is it directly in the template page ? Or simply in the content of the post (page).

I just need to custom 500 and 1000 error pages.

For the moment, the result of the preview looks KO (in this test, " ::CLOUDFLARE_ERROR_500S_BOX:: " is inserted) :

# Custom error preview failed

Status code 500 received while fetching template from https://mysite.fr/error-500/

* **target** : one of
  * [cf-error:1000s](https://cloudflarepreview.com/preview-cpage?act=preview&target=cf-error:1000s)
  * [block:ip-ban](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:ip-ban)
  * [block:rate-limit](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:rate-limit)
  * [block:client-auth](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:client-auth)
  * [block:basic-sec-captcha](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:basic-sec-captcha)
  * [block:country-captcha](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:country-captcha)
  * [block:adv-sec-captcha](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:adv-sec-captcha)
  * [block:waf](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:waf)
  * [block:iuam-basic](https://cloudflarepreview.com/preview-cpage?act=preview&target=block:iuam-basic)
  * [cf-error:500s](https://cloudflarepreview.com/preview-cpage?act=preview&target=cf-error:500s)
  * [always-online:no-copy](https://cloudflarepreview.com/preview-cpage?act=preview&target=always-online:no-copy)
  * [phishing:warn](https://cloudflarepreview.com/preview-cpage?act=preview&target=phishing:warn)
  * [regulation:block](https://cloudflarepreview.com/preview-cpage?act=preview&target=regulation:block)
* **url** : custom template URL to fetch (optional, uses default template when omitted)

Thanks,
Regards

I created a WordPress page that looks like this. It’s my standard Header/Footer, plus an H1 and and H4 block:

And it Previews like this in Custom Error Pages:

Hi,

Thank you for your proposition / test.

I’ve tested by putting the default page and as a title :

::CLOUDFLARE_ERROR_500S_BOX::

I still have : Custom error preview failed

Would you have any other idea ? Or another setting to change ?

Trying to use WordPress to layout a custom error page is going to be a challenge. It took me a while to weed out all the fluff to get that custom error page to work. The page size has to be relatively small, <1.5 megs, I think. And any number of syntax oddities may throw off Cloudflare’s use of that page.

The Chrome console says there’s only one error with the favicon.
In the “Network” tab, a 200 line for the Cloudflare page, and a 403 line for the favicon.

Would there be any way to exclude the favicon from the Cloudflare dashboard ?

Regards,

Custom Error pages disregard the favicon from your template page.

OK.

The preview is still KO. Now I test to publish directly and I get this message :

“Your custom page must be larger than 100 characters (Code: 1203)”

But it does have more than 100 char.

Would you see a link between that message at publishing and the error when trying a preview ?

I also faced that same error, even though I had more than 100 characters. WordPress is not a good way to try to generate a custom error page…unless you want to comb through every bit of the generated page to simplify it for Cloudflare.

ok I give up :slight_smile:

At least I postpone the project…

Thanks again.
regards

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.