Skip to content
Back to Blog
WordPress10 min read

Common WordPress Errors on Shared Hosting and How to Fix Them

Running WordPress on shared hosting comes with its own set of challenges. Learn how to diagnose and fix the most frequent errors — from the White Screen of Death to database connection failures.

Written by Abdul AbrorTechnical Hosting Support Engineer
On this page

Shared hosting is where most WordPress websites start — it is affordable, easy to set up, and perfectly capable for small to medium sites. But it comes with constraints: limited memory, shared resources, and server configurations that occasionally clash with WordPress. This guide covers the most common errors you will encounter and exactly how to fix each one.

1. Error Establishing a Database Connection

This is one of the most alarming errors in WordPress — your entire website shows a blank page with the message “Error establishing a database connection.” It means WordPress cannot connect to your MySQL database.

Common causes:

  • Incorrect database credentials in wp-config.php
  • The MySQL server is temporarily down (common on shared hosting)
  • Your database was deleted or corrupted
  • Your hosting account ran out of disk space

How to fix it:

First, check your wp-config.php file via cPanel File Manager or FTP. Confirm that DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST match the values in cPanel under MySQL Databases. On most shared hosts, DB_HOST is simply localhost.

define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_database_user');
define('DB_PASSWORD', 'your_database_password');
define('DB_HOST', 'localhost');

If credentials are correct, try accessing cPanel and opening phpMyAdmin to see if your database is accessible. If phpMyAdmin itself is slow or unresponsive, the MySQL server may be overloaded — contact your hosting support and ask them to check the MySQL service status.

Also check your disk space usage in cPanel. If your account is at 100% disk usage, MySQL cannot write new data and connections may fail. Delete unnecessary files, email attachments, or old backups to free up space.

2. The White Screen of Death (WSOD)

A completely blank white page with no error message is called the WordPress White Screen of Death. It is caused by a PHP fatal error, but error display is turned off so you see nothing.

How to fix it:

Step 1: Enable WordPress debug mode. Add the following lines to your wp-config.php file:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

This writes errors to /wp-content/debug.log without showing them to visitors. Check that file to find the specific error.

Step 2: Deactivate all plugins. Via FTP or cPanel File Manager, rename the /wp-content/plugins/ folder to /wp-content/plugins-disabled/. If your site comes back, a plugin was causing the issue. Rename the folder back, then deactivate plugins one by one to find the culprit.

Step 3: Switch to a default theme. Via FTP, rename your active theme folder inside /wp-content/themes/. WordPress will fall back to a default theme. If that fixes the white screen, your theme has a PHP error.

Step 4: Increase PHP memory limit. Add this to your wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

3. 500 Internal Server Error

A 500 error means the server encountered an unexpected condition and could not complete the request. On shared hosting, this is almost always caused by a corrupted .htaccess file or a PHP memory/execution limit being exceeded.

Fix 1: Regenerate .htaccess

Via cPanel File Manager, navigate to your WordPress root directory and find the .htaccess file. (You may need to enable hidden files — tick Show Hidden Files in File Manager settings.) Rename it to .htaccess-old, then log in to your WordPress admin and go to Settings → Permalinks and click Save Changes. WordPress will generate a fresh .htaccess file.

The default WordPress .htaccess should look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Fix 2: Increase PHP limits via .htaccess

Add the following to your .htaccess file to raise common limits:

php_value memory_limit 256M
php_value max_execution_time 300
php_value upload_max_filesize 64M
php_value post_max_size 64M

Note: Some shared hosting providers do not allow php_value directives in .htaccess. In that case, create or edit a php.ini file in your WordPress root with the same values.

4. 403 Forbidden Error

A 403 error means the server is refusing to serve the requested file or directory. On shared hosting, this is most often a file permissions issue.

WordPress files should have permissions of 644 and directories should be 755. Anything more restrictive than this will cause 403 errors.

In cPanel File Manager, select all files in your WordPress directory, right-click, and choose Change Permissions. Set files to 644 and directories to 755.

Alternatively, run these commands via SSH:

find /home/user/public_html -type f -exec chmod 644 {} ;
find /home/user/public_html -type d -exec chmod 755 {} ;

5. Memory Limit Exhausted

You may see an error like: “Fatal error: Allowed memory size of 33554432 bytes exhausted.”

This means WordPress is trying to use more PHP memory than your hosting plan allows. The default limit on many shared hosts is 32MB or 64MB — far below what a modern WordPress site with plugins needs (typically 128MB–256MB).

Fix this by adding to wp-config.php:

define('WP_MEMORY_LIMIT', '256M');

If that does not work, the server-level PHP limit may be lower. Contact your hosting support and ask them to increase the memory_limit in your PHP configuration. You can also check and change your PHP version in cPanel under MultiPHP Manager — newer PHP versions (8.1, 8.2) use memory more efficiently than older ones.

6. WordPress Is Slow on Shared Hosting

Slow page load times are not technically an error, but they are one of the most common complaints from WordPress users on shared hosting. Google's Core Web Vitals make speed directly relevant to your search rankings.

Quick wins for shared hosting speed:

  • Install a caching plugin. WP Super Cache or W3 Total Cache generate static HTML files so PHP and MySQL do not have to run on every page request.
  • Enable GZIP compression. Add AddOutputFilterByType DEFLATE text/html text/css application/javascript to your .htaccess, or enable it through your caching plugin.
  • Optimise your images. Use a plugin like Smush or ShortPixel to compress images without visible quality loss. Large uncompressed images are the single biggest cause of slow WordPress sites.
  • Use a CDN. Cloudflare's free plan is excellent for shared hosting — it caches static assets (images, CSS, JS) at edge servers worldwide and reduces load on your hosting server.
  • Limit your plugins. Every active plugin adds PHP execution time. Audit your plugins and deactivate any you do not actively use.
  • Use PHP 8.x. PHP 8.1 and 8.2 are significantly faster than PHP 7.x. Switch in cPanel under MultiPHP Manager after confirming your plugins and theme are compatible.

7. Too Many Redirects

If your browser shows “This page isn't redirecting properly” or “ERR_TOO_MANY_REDIRECTS,” WordPress is caught in a redirect loop. This is common after migrating a site or enabling SSL.

The most common fix is to check your WordPress URL settings. In cPanel phpMyAdmin, open your WordPress database and look in the wp_options table. Find the rows siteurl and home and make sure both use the correct protocol (https:// if SSL is active, http:// if not) and the correct domain.

Also check your .htaccess for conflicting redirect rules. A common problem is having both a WordPress redirect to HTTPS and a plugin redirect to HTTPS, creating a loop. Keep only one method active.

General Troubleshooting Approach

When you encounter any WordPress error on shared hosting, follow this sequence:

  1. Enable WP_DEBUG and check debug.log for the exact error
  2. Check cPanel Error Logs under Logs → Error Log
  3. Deactivate all plugins and test
  4. Switch to a default theme and test
  5. Check .htaccess for corruption
  6. Verify database credentials in wp-config.php
  7. Check disk space and PHP memory limits
  8. Contact hosting support with the specific error message

Most WordPress errors on shared hosting come down to a small set of root causes: misconfigured files, resource limits, or plugin/theme conflicts. Working through this checklist systematically will resolve the vast majority of issues without needing to contact support.