,

Fix WordPress “content can’t be displayed” error

The Problem

You just installed WordPress and you can’t edit any pages or posts. The system returns an error “The content can’t be displayed. Please contact your site Administrator.”

This is likely an error in your web-server configuration related to Content Security Policy (CSP). CSP is a security method and beyond the scope of this post. You’ve received the error because CSP is not configured properly.

If you are self hosting….let’s fix it.

A Solution

CSP headers (a bit of hidden code in your website) are added by the web server or the firewall. Because there are many variations here I won’t go through each. Look at your web-server.htaccess file and your firewall configuration file.

For example, look at these locations for your configuration file:

web server: /var/www/html/.htaccess
Ngnix Proxy: /var/www/html/nginx-conf/nginix.conf

Look for line that looks like this:

dd_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;

And then comment it out with a hash mark:

# dd_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;

Save your revised settings. Restart your web-server or firewall and test it out. You should no longer see the error. If you really need CSP you can research it further and properly configure it.

Leave a Reply

Your email address will not be published. Required fields are marked *