Common WordPress errors

We've gathered the most common WordPress errors, from the white screen and the critical error, through database connections and file uploads, to updates, redirects, and SSL certificates. For each error you'll find the common cause and how to fix it, along with the matching setting or WP-CLI command.

Site not loading

  • There has been a critical error on this website.

    Critical error
    Common cause
    A recently installed or updated plugin or theme, an incompatible PHP version, or exceeding the memory limit.
    First check
    An email with a recovery mode link in the site administrator's inbox.

    When WordPress detects a fatal error, it emails the site administrator the error details and a login link to recovery mode. The link opens the WordPress dashboard with the faulty component paused, so you can update, replace, or deactivate it. If the email didn't arrive, turn on the error log with WP_DEBUG and WP_DEBUG_LOG and check wp-content/debug.log. To send these emails to another address, use the RECOVERY_MODE_EMAIL constant in wp-config.php.

  • White Screen of Death

    Blank page
    Common cause
    A PHP error in a plugin or theme while error display is turned off.
    Command
    wp plugin deactivate --all --skip-plugins --skip-themes

    Deactivate all plugins and check whether the site comes back. Without dashboard access, rename wp-content/plugins to plugins_old in the file manager or over FTP. Once the site loads, restore the original name and activate the plugins one by one until the issue returns. If plugins are not the cause, switch to a default WordPress theme, or rename the active theme's folder in wp-content/themes. The error log shows the file and line that caused the issue.

  • 500 Internal Server Error

    HTTP 500
    Common cause
    A corrupt .htaccess file, a plugin or theme, exceeding the memory limit, or corrupt core files.
    First check
    Rename .htaccess to .htaccess_old and reload the site.

    If the site loads after renaming .htaccess, go to Settings > Permalinks and click Save, and WordPress creates a new file. If it still doesn't load, deactivate the plugins, switch to a default theme, and raise the memory limit. If that doesn't help either, upload the wp-admin and wp-includes folders again from a fresh copy of the same WordPress version. The server error log usually shows the exact cause.

  • 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout

    HTTP 502-504
    Common cause
    An unusually long request, a plugin calling a slow external service, or unusual load from visitors or bots.

    These errors mean the server didn't get a timely response from the component that runs the site, or the service is temporarily overloaded. Check whether the error repeats on a specific page or after a specific action, such as an import, a backup, or a form submission, and deactivate the related plugin. Run heavy tasks at quiet hours and split large imports into parts. A 503 right after an update is usually caused by the .maintenance file. If the error persists, contact your hosting support with the URL and time it appeared.

  • Connection timed out

    Timeout
    Common cause
    The site needs more resources than are available to it, usually because of a heavy plugin or theme.

    Deactivate the plugins and reactivate them one by one, and temporarily switch to a default theme to see whether the theme is the cause. Then raise the memory limit in wp-config.php and max_execution_time in the PHP settings. If the site has grown and the issue returns mainly at peak hours, it's time to move to a plan with more resources.

Database

  • Error establishing a database connection

    Database
    Common cause
    Wrong database details in wp-config.php, or the database server is unavailable.
    Settings to check
    DB_NAME, DB_USER, DB_PASSWORD, DB_HOST

    Open wp-config.php and compare the four values with the database details in your hosting control panel. After a site migration or a password change, this is the most common cause. If the details look correct, set a new password for the database user in the control panel and update it in the file as well. If the error comes and goes, the database server may be overloaded or temporarily unavailable, so contact your hosting support.

  • One or more database tables are unavailable

    Corrupt table
    Common cause
    A corrupt table in the database.
    Setting
    define( 'WP_ALLOW_REPAIR', true );

    Back up the database first. Add the constant to wp-config.php and open /wp-admin/maint/repair.php on your site, where you can repair the tables, with or without optimization. The page opens without logging in, so delete the line as soon as you finish. On a server with command line access, you can check the tables with wp db check and repair them with wp db repair.

PHP and code

  • Allowed memory size of ... bytes exhausted

    Memory
    Common cause
    A heavy plugin, a large import, or image processing that needs more memory than the limit.
    Setting
    define( 'WP_MEMORY_LIMIT', '256M' );

    Add the constant to wp-config.php, above the line That's all, stop editing. The WordPress default is 40M for a single site and 64M for a multisite network, and the admin screens have a separate constant, WP_MAX_MEMORY_LIMIT. The constant can't exceed memory_limit when the PHP setting can't be changed, so you may also need to raise memory_limit in the hosting control panel or in .user.ini. If memory keeps running out, find the plugin using it.

  • Maximum execution time of 30 seconds exceeded

    Execution time
    Common cause
    A long task, such as an import, a backup, an update, or a call to a slow external service.
    Setting
    max_execution_time = 60

    Raise max_execution_time in the PHP settings, in the hosting control panel or in a .user.ini file. The PHP default is 30 seconds. The line php_value max_execution_time 60 in .htaccess works only when PHP runs as an Apache module, so back up the file before the change. If the error keeps returning in the same task, it's better to split it into smaller parts, for example an import in several files.

  • Parse error: syntax error, unexpected ...

    Syntax error
    Common cause
    Manual editing of functions.php or another PHP file, with a missing semicolon, bracket, or quote.
    First check
    The file name and line number shown in the message.

    Open the file from the message in the file manager or over FTP and check the line shown and the lines before it, since the mistake is often on the previous line. The fastest fix is to restore the copy saved before the edit. The messages unexpected identifier and unexpected token usually point to a semicolon or quote missing on the previous line, and Unmatched ')' points to a closing bracket with no matching opening one. Save a copy of the file before every edit.

  • Cannot modify header information - headers already sent

    PHP warning
    Common cause
    A space or blank line before <?php or after ?> in a file, usually wp-config.php or functions.php.

    The message shows the file and line where the output started, after the words output started at. Open the file and delete any spaces and blank lines before <?php at its start and after ?> at its end. If the error appeared right after an installation, check wp-config.php first.

File uploads

  • The uploaded file exceeds the upload_max_filesize directive in php.ini.

    File size
    Common cause
    The file is larger than the upload_max_filesize limit, which defaults to 2M in PHP.
    Setting
    upload_max_filesize = 64M, post_max_size = 72M

    Raise upload_max_filesize and post_max_size, with post_max_size slightly higher, in the hosting control panel or in a .user.ini file in the site folder. Neither setting can be changed with ini_set() in code or with a WordPress constant. The media upload screen shows the maximum upload size, so you can confirm the change took effect.

  • The link you followed has expired. / Are you sure you want to do this?

    HTTP 403
    Common cause
    The form's security token expired, or the uploaded file exceeded post_max_size and the form arrived empty.

    This message appears when WordPress can't verify the request. If the page was open for a long time, refresh it and try again. If it appears when uploading a theme or plugin, the file is over the limit: raise post_max_size and upload_max_filesize, or extract the file and upload the folder directly to wp-content/themes or wp-content/plugins. If it appears only with a specific plugin, update or deactivate it. In older WordPress versions, the message read Are you sure you want to do this?

  • Sorry, you are not allowed to upload this file type.

    File type
    Common cause
    The file type is not on the list WordPress allows, or the extension doesn't match the file content.

    WordPress allows uploads of common file types, such as images, documents, audio, and video. Check that the extension is correct and that the file wasn't saved in another format. To add a file type, use the upload_mimes filter in a code plugin, and add only common, safe types. The ALLOW_UNFILTERED_UPLOADS constant turns the check off for administrators, so don't leave it active.

  • Missing a temporary folder.

    Temp folder
    Common cause
    The temporary folder where PHP stores files during upload doesn't exist or isn't writable.
    Setting
    upload_tmp_dir

    This error comes from PHP itself, before WordPress even receives the file. The folder is set by upload_tmp_dir, and when it's empty, PHP uses the system's temporary folder. The setting can be changed only in the main PHP configuration, so on a hosting plan, contact support. On a VPS, check that the folder exists and that the user running PHP can write to it.

  • Failed to write file to disk.

    Permissions
    Common cause
    No write permission for the folder, or the hosting account is out of disk space.

    Check in the hosting control panel whether all disk space is used, and free up space, for example old backups saved inside the site folder. Then check that wp-content/uploads belongs to the site's user and that permissions are 755 for folders and 644 for files. The message Unable to create directory points to the same issue in the uploads folder. Never set 777 permissions, which let any user and process on the server write to the folder.

Installs and updates

  • Briefly unavailable for scheduled maintenance.

    HTTP 503
    Common cause
    An interrupted update left the .maintenance file in the site's root folder.
    Command
    wp maintenance-mode deactivate

    WordPress creates the .maintenance file when an update starts and deletes it when it ends. If the update was interrupted, delete the file from the site's root folder in the file manager or over FTP, and if you don't see it, turn on showing hidden files. A file created more than 10 minutes ago no longer keeps the site in maintenance mode. Once the site is back, check on the Updates screen that the update completed, and run it again if needed.

  • Another update is currently in progress.

    Update
    Common cause
    An update lock left in the database by an earlier update that didn't finish.
    Command
    wp option delete core_updater.lock

    WordPress locks core updates so that two updates don't run at once, and the lock is released on its own after 15 minutes. So waiting and trying again is usually enough. If you need to continue right away, and only when no update is running at that moment, delete the core_updater.lock row from the wp_options table, or run the command on a server with command line access.

  • The update cannot be installed because some files could not be copied.

    Update
    Common cause
    Inconsistent file permissions, or not enough space in the hosting account.
    Command
    wp core verify-checksums

    Fix the permissions so all WordPress files belong to the site's user, and check there's enough free space. If the automatic update fails again, update manually: back up the site and database, download the latest version from wordpress.org, and replace the wp-admin and wp-includes folders and the root files, except wp-config.php and the wp-content folder. The wp core verify-checksums command compares the core files with the official release.

  • Could not create directory.

    Installation
    Common cause
    WordPress can't write to the wp-content folder or to the plugins, themes, and upgrade folders inside it.

    This message appears when installing or updating a plugin, a theme, or WordPress itself. Check that the folders belong to the site's user and that their permissions are 755. Running out of disk space also makes folder creation fail, so check your disk usage too. You can also install a plugin manually: extract the file and upload the folder to wp-content/plugins.

  • Connection Information prompt

    Installation
    Common cause
    WordPress can't write to the files directly, because they belong to a different user from the one running the site.
    Setting
    FS_METHOD: direct, ssh2, ftpext, or ftpsockets

    The right fix is to correct the ownership of the site files, so they belong to the user running the site, and then WordPress writes directly without asking for connection details. The FS_METHOD constant in wp-config.php sets how files are written. According to the official documentation, the direct value can open security holes on a server that isn't configured properly, so if the change doesn't help, remove it.

URLs, SSL, and login

  • Too many redirects (ERR_TOO_MANY_REDIRECTS)

    Redirects
    Common cause
    Conflicting URLs in the site settings or wp-config.php, or an HTTPS redirect set in more than one place.
    Command
    wp option get siteurl

    Check that WordPress Address and Site Address in Settings > General start with the same protocol, http or https, with no trailing /. Without dashboard access, set them temporarily in wp-config.php with the WP_HOME and WP_SITEURL constants. Then check that the redirect to HTTPS or www isn't set twice, for example both in .htaccess and in a plugin or CDN service. Finally, clear the site's cookies in your browser.

  • Mixed Content

    SSL
    Common cause
    Images, scripts, and links saved in the database with http:// URLs before the move to HTTPS.
    Command
    wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid --dry-run

    After installing an SSL certificate, change both addresses in Settings > General to https. Older content keeps its http URLs, so replace them in the database: back it up, run the command with --dry-run to see how many changes it will make, then run it again without --dry-run. Without command line access, use a search and replace plugin. Fix URLs hardcoded in theme files by editing those files directly, and the Console tab in the browser's developer tools shows which files still load over http.

  • Cookies are blocked or not supported

    Login
    Common cause
    The browser blocks cookies, a conflicting plugin, a COOKIE_DOMAIN that doesn't match the URL, or a cached login page.

    Allow cookies for the site in your browser and try again. If the message persists, temporarily deactivate the plugins, check that the COOKIE_DOMAIN constant in wp-config.php, if set, matches the site URL, and make sure the whole site runs over HTTPS. In your caching plugin, exclude wp-login.php and logged-in users.

  • Login redirect loop

    Login
    Common cause
    Old cookies, wrong URLs in WP_HOME, WP_SITEURL, or the database, or a conflicting plugin.
    Command
    wp user update USERNAME --prompt=user_pass

    After you enter your password, the login page loads again. Clear the site's cookies in your browser, check WP_HOME and WP_SITEURL in wp-config.php and the siteurl and home values in the wp_options table, and temporarily rename the plugins folder to test for a plugin conflict. If you forgot the password, use the password reset link on the login page, and on a server with command line access, set a new password with the command on this card.

  • 404 errors on posts and pages

    HTTP 404
    Common cause
    The permalink rewrite rules are missing from .htaccess, usually after a site migration.
    Command
    wp rewrite flush --hard

    Go to Settings > Permalinks and click Save without changing anything, and WordPress rewrites the rules. If that doesn't help, check that the .htaccess file in the root folder contains the block between # BEGIN WordPress and # END WordPress. A home page that loads while every other page returns 404 is a clear sign of this issue. For a 404 on a custom post type, save the default structure once, then switch back to the structure you want.

  • 403 Forbidden

    HTTP 403
    Common cause
    Wrong file permissions, a blocking rule in .htaccess, a security plugin, or a WAF that blocked a request.

    Check that permissions are 755 for folders and 644 for files. Temporarily rename .htaccess and see whether access returns, then recreate it by saving the permalinks. If the block appears only for a specific action, such as saving a page or uploading a file, the WAF may have flagged the request as suspicious, so contact support with the exact URL and time. If a security plugin blocked your IP address, unblock it in the plugin settings or temporarily rename its folder.

Display and content

  • Images not displaying

    Media
    Common cause
    Old URLs in the database after a site migration, uploads folder permissions, or mixed content over HTTPS.
    Command
    wp media regenerate --only-missing

    Open the image URL in a new tab. If it points to the old domain, replace the URLs in the database with wp search-replace, after a backup. If you get a 403 or 404 error, check that the file exists in wp-content/uploads and that permissions are 755 for folders and 644 for files. If only some image sizes are missing, for example after changing themes, regenerate them with the command on this card.

  • Sidebar drops below the content

    Theme
    Common cause
    An unclosed HTML tag in a post or widget, or an image, table, or embed wider than the column.

    Check whether the issue appears across the site or only on a specific page. On a specific page, open the post's code editor, look for a div tag that was opened and not closed or an element with a fixed width wider than the column, and fix it. If it appears across the site, disable recently added widgets one by one and check recent changes to theme files or additional CSS. Switching temporarily to a default theme shows whether the theme is the cause.

  • RSS feed error (XML Parsing Error)

    Feed
    Common cause
    A space or blank line before <?php or after ?> in a plugin or theme file, sent before the XML starts.

    The site feed is at /feed/. Open it in your browser and check, at the line and column in the message, what appears before the XML starts. The common cause is a space at the start of wp-config.php or at the end of functions.php, and in that case, delete it. If the files are fine, deactivate the plugins one by one to find the one adding output to the feed, and clear the cache so a broken version of the feed doesn't keep showing.

Before you start

Before any fix, back up the site files and the database, and change one thing at a time so you know what solved the issue. When the message on screen is generic, the WordPress error log shows the exact file and line. Add the following lines to wp-config.php, above the line That's all, stop editing:

PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Errors are written to wp-content/debug.log and are not shown to visitors. Write true and false without quotes, because the value 'false' in quotes counts as true. According to the official documentation, debug mode is meant for troubleshooting and not for permanent use on a live site, so when you finish, set WP_DEBUG back to false and delete the debug.log file.

The WP-CLI commands on the cards suit a server with command line access, such as a VPS, and you run them from the site's root folder. When the site crashes and WP-CLI won't load, add both options --skip-plugins --skip-themes to the command. Without command line access, you can do most of these tasks in the file manager and phpMyAdmin in your hosting control panel. More commands are on the WP-CLI commands page, and the memory_limit, upload_max_filesize, and max_execution_time settings are explained on the php.ini directives page.

Did you know?

With WordPress hosting plans, your site gets daily backups and a weekly backup, with free restores from backup, so you can always roll back to an earlier version of your site. You can choose the PHP version for each site separately, and a free SSL certificate and personal support via HelpDesk are included in every plan.

WordPress hosting plans

WordPress errors FAQ

What should I do when I see the message There has been a critical error on this website?

This message appears when a fatal error, usually in a plugin or theme, stops the site from loading. At the same time, WordPress emails the site administrator the error details and a recovery mode link. The link opens the WordPress dashboard with the faulty component paused, so you can update, replace, or deactivate it. If the email didn't arrive, turn on the error log and check the wp-content/debug.log file.

How do I turn on the WordPress error log?

Add the WP_DEBUG and WP_DEBUG_LOG constants with the value true to wp-config.php, and WP_DEBUG_DISPLAY with the value false, so errors are not shown to visitors. Errors are written to wp-content/debug.log, with the file name and line number of each error. When you finish checking, set WP_DEBUG back to false and delete the file.

How do I increase the memory limit in WordPress?

Add the line define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, above the line That's all, stop editing. The constant works up to the memory_limit value in the PHP settings, so if the error continues, also raise memory_limit in the hosting control panel or in a .user.ini file. If memory keeps running out, find the plugin using it.

Why do posts return a 404 error after a site migration?

In most cases, the permalink rewrite rules are missing from the .htaccess file. Go to Settings > Permalinks and click Save without changing anything, and WordPress rewrites the rules. If the issue persists, check that the block between # BEGIN WordPress and # END WordPress exists in the .htaccess file in the site's root folder.

How do I get my site working again after a failed update?

When the site shows the message Briefly unavailable for scheduled maintenance, delete the .maintenance file from the site's root folder and run the update again. When the site crashes after a plugin update, temporarily rename the plugin's folder in wp-content/plugins. For a wider issue, restore the site from the last backup saved before the update. With our WordPress hosting plans, your site is backed up every day, and restores from backup are free.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement