Troubleshooting: Page Builder hangs every time I click Publish or Save

When you make edits to a Page Builder layout and find that Publish or Save consistently hangs, it may be because of a mod_security issue on your hosting server.

Usually, this happens when you add some custom code to one of your modules, such as adding an <iframe> or <script> tag, but it has even been triggered by using the word select in a Text module.

Technical details

Mod_security is an Apache module that serves as a web application firewall. When you save or publish a page, a POST object is sent to the admin Ajax, and it is scanned by modsec if mod_security is enabled. Tags like <iframe> and <script> (non-UTF-8 characters) or words like select, which Is a keyword used in MySQL queries, can be interpreted as a security threat and produce a 403 or 406 error in Ajax, causing the Save or Publish to hang.

You can find out whether your hosting server is using mod_security by asking your hosting provider or, if you know PHP, by using phpinfo().  Note that a 406 error usually indicates that mod_security is in use.


You can add the following line to the wp-config.php file in your WordPress home directory:

define( 'FL_BUILDER_MODSEC_FIX', true );

This line causes the request to be base64-encoded so modsec sees the offending tags and text as binary data and allows it to pass through.