List of common errors when using wordpress
Continuing the series of articles on fixing common errors in WordPress, this time I will share how to fix 10 common errors when using the wordpress sales theme that most people have encountered. This article will help you save time and effort when encountering these problems, without having to search on many different sources.
Lỗi 1. Fatal Error: Allowed Memory Size Of XXX Bytes Exhausted

Sometimes, when you are working on a website, you may encounter this error. It can happen frequently or only occasionally. When you encounter an error, you will see the website display a white error message and a warning “Fatal Error: Allowed Memory Size Of XXX Bytes Exhausted”.
Cause & Solution:
This error usually occurs because the server’s total memory is not enough to support the WordPress PHP application, especially when using free hosts or having too much data on the website.
To fix it, you can try adding the following code to the wp-config.php file:
define( ‘WP_MAX_MEMORY_LIMIT’, ‘512M’ );
If it still doesn’t work, you can add the following code to the .htaccess file in the root directory (if using Shared Host or Apache):
php_value memory_limit 512M
If the above method still fails, you can create a php.ini file in the root directory of the website and add the following line:
memory_limit=512M
If you have difficulty performing the above steps, please contact the technical support team for assistance, as some providers do not allow users to change these settings themselves.
Error 2. Warning: Cannot Modify Header Information
Usually when updating WordPress, theme or plugin, you will encounter the error message Warning: Cannot modify header information – headers already sent by….appearing above.
Cause & Solution:
For WordPress, the main cause is that the corrupted file (see the error message) has an extra space at the beginning of the line at the end of the file to ensure safety.
Or if you use Notepad++ to open the file, select Encoding -> UTF-8 without BOM to solve this problem.
Error 3. “Briefly Unavailable For Scheduled Maintenance”
After updating WordPress, theme or plugin, you may encounter this error message when clicking on other tasks.
Cause & Solution:
When updating, WordPress will automatically switch the website to maintenance status to update new features and avoid unexpected errors. Usually, this error will fix itself after a few seconds or minutes.
However, in some rare cases, the update process may fail and WordPress cannot revert the website’s status. To fix it, you can delete the .maintenance file in the root directory via FTP. Then everything will return to normal.
The website will return to its original state, so it will display this message almost forever. At that time, try to fix it by deleting the .maintenance file in the root directory via FTP. Then everything will return to normal.
Error 4. Blank Page Error
One of the common errors that WordPress users often encounter is the blank page error, which causes the website to not display any content. This can happen for many different reasons.
Causes & Solutions:
The most common causes are usually:
Plugin/Theme Error: Some plugins or themes that are not compatible with the current WordPress version or with each other can cause the blank page error. Try temporarily disabling plugins or switching to the default theme to check if this is the case.
.htaccess file error: If you have edited the .htaccess file and made a mistake, this can also cause the blank page error. Delete all the contents of the .htaccess file and try loading the website again.
Memory error: If your website has too much data or is using free hosting with limited memory, this can cause the blank page error. Contact your hosting provider for support to increase memory or upgrade your hosting package.
PHP version error: If the PHP version on your server is not compatible with the current WordPress version, this can also cause the blank page error. Contact your hosting provider for support in upgrading your PHP version.
Index.php file error: If the index.php file is missing or corrupted, this can also cause a blank page error. Check to see if this file exists and is not corrupted.
So, when you encounter a blank page, remember the recent changes and check again to fix it. Or you can check the website error message to know the cause of the error.
To display the error message on the browser, you can open the wp-config.php file and find WP_DEBUG, then change the value from false to true. At the same time, you should also add the following two lines of code right below:
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, true );
Then, visit the website again to check if the error message is displayed. If not, you can go to the wp-content folder and open the debug.log file to see the error details.
After fixing the error, don’t forget to edit the value ofa WP_DEBUG to false and remove the two lines of code you just added.
Note: Encountering a blank page error? Read the log file to find out the cause and fix it now!
Error 5. Being asked for FTP account when installing theme/plugin

If you encounter this problem when installing a plugin or theme on WordPress, it means that the access permissions to the directory on the host are not set correctly. This leads to PHP not being able to write new data to the website directory. Therefore, make sure that all the directories on the host are CHMOD 755 and the files are 644.
If you are using a Shared Host, contact the provider for support to reset the access permissions.
If you are using a VPS/dedicated server, make sure that the access permissions for the directories are set so that the user running PHP can interact. For example:
chown -R apache:apache /path/domain.com
Or if you are using NGINX (CentOS):
chown -R nginx:nginx /path/domain.com
If you are using Ubuntu/Debian:
chown -R www-data:www-data /path/domain.com
Error 6. Error Establishing A Database Connection
There are two cases where this error can occur:
The database configuration information in your wp-config.php file may be entered incorrectly.
MySQL is overloaded and cannot handle the data sent and received, especially on weak hosts or under DDoS attacks.
MySQL is full so it cannot start
Error 7. 404 Not Found when viewing the article
This is a common error that most people know that the server cannot find the file that the user requested on the browser. In WordPress, many people will encounter this error when viewing a post or other content after customizing the path.
The reason for this problem is that the URL rewrite mechanism is not enabled on your site because the .htaccess file is not configured to rewrite rules. To solve this problem, you can go to Settings -> Permalinks and press the Save Changes button. If it still fails, you can add the following code to the .htaccess file in the root directory of the site:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPressIf you use NGINX as a webserver with PHP-FPM, please refer to the NGINX configurations for WordPress.
Error 8. Stylesheet Is Missing

For new WordPress users, it is common to encounter problems when downloading and installing themes from the internet instead of using themes available in the library.
There are two main reasons for this error:
Missing style.css file in the theme package (rare).
The theme package is not compressed properly. To install successfully, you need to make sure that the theme package has the correct structure /wp-content/themes/theme-name/style.css when uploading to the host. ### Error 10. PCLZIP_ERR_BAD_FORMAT (-10).
Error 9. PCLZIP_ERR_BAD_FORMAT (-10).

This is also a common error when uploading themes from your computer. The reason is that the theme you uploaded is in .rar format, not .zip. WordPress only accepts .zip files so it can automatically decompress them.
The solution is to unzip the theme and recompress it to .zip instead of .rar.
Error 10. Error: The uploaded file exceeds the upload_max_filesize
This is a common problem when using Shared Host and can occur when you upload a file to the host. The cause of this problem is that the file you uploaded exceeds the PHP limit set by the server.
To fix this, you can add the following code to the .htaccess file in the host’s root directory to increase the limit to 10MB.
php_value upload_max_filesize 100M php_value post_max_size 100M
If adding code to .htaccess causes a 500 error, you can delete that code and create a php.ini file in the root directory of the website, then add the following code:
upload_max_filesize = 100M post_max_size = 100M `
See more:
- Instructions on how to update WordPress manually without losing data, the safest
- Instructions on installing WordPress on localhost
- 10 common errors when using WordPress
- Instructions on how to localize WordPress themes and plugins with the Loco Translate plugin
- Count website visits professionally with WP Statistics

