惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
罗磊的独立博客
B
Blog
博客园_首页
A
About on SuperTechFans
有赞技术团队
有赞技术团队
V
V2EX
U
Unit 42
I
InfoQ
IT之家
IT之家
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
H
Help Net Security

Pressable

Pressable Achieves Secure Hosting Alliance Certification | Pressable How Pressable MCP Is Changing The Game For WordPress Agencies: A Live Breakdown With Matt Medeiros And Phill Clapham | Pressable April Product Update: Navigation, Organization, And Efficiency | Pressable White-Label WordPress Hosting For Profitable Agencies | Pressable A Guide To Client Onboarding For WordPress Agencies| Pressable WordPress Plugin Management For Scalable Agencies | Pressable WordPress Maintenance Contracts For Agencies: A Complete Guide | Pressable 6 Essential SOPs For WordPress Agencies | Pressable Pressable MCP: Control Your WordPress Hosting With AI. | Pressable WordPress Hosting Cost: Pricing Tiers And What To Expect | Pressable WordPress Performance Budgets: Setting And Monitoring Goals | Pressable WordPress Automation With No Code Automation Tools | Pressable Implement Single Sign-On (SSO) In WordPress | Pressable How To Build A Real Estate Site On WordPress | Pressable Headless WordPress Showdown: Next.js Vs Gatsby | Pressable How To Automate White-Label WordPress Hosting With WHMCS | Pressable Developer Toolkit Update: Automation & UI Enhancements | Pressable How To Build A DXP Platform With WordPress How To Boost WordPress Agency Client Retention: 4 Strategies White Label WordPress Admin For Agency Clients Performance Testing For WordPress Agency Client Sites Performance Testing For WordPress: A Framework For Agency Client Sites How To Upload A Video To WordPress | Pressable How To Mitigate The Impact Of AI Scraper Bots On WordPress Sites WooCommerce ERP Integration: Automate Your Back Office WordPress Personalization: How To Display Tailored Content To Visitors | Pressable WooCommerce Conversion Rate Optimization: A Data-Driven Approach How To Price Your Online Course: WordPress Monetization Guide 7 Ecommerce KPIs You Should Be Measuring | Pressable WooCommerce Vs. BigCommerce: Which Is Best For Your Business Needs? | Pressable WooCommerce Performance Troubleshooting: Diagnosing Speed Issues Step-by-Step | Pressable
7 Common WordPress Errors And How To Fix Them
Zach Wiesman · 2018-04-18 · via Pressable

Keyboard with orange button that says oops

Ask Your Favorite AI

Copy the link to a markdown format of this article for ChatGPT, Claude, Gemini, or your favorite AI.

WordPress is a great piece of software that works fine most of the time. But there are times when things stop working. Maybe WordPress can’t connect to the database or maybe some files have been corrupted. Whatever the case may be, here are seven of the most common WordPress errors and how you can fix them.

Before you go on and follow any of the steps below, make a backup of your whole website. When trying to fix your website, you might break it even more. Having a backup ensures you can always revert back to the “less-broken” state of your website. So, before you make any changes to your website, back it up.

Error Establishing a Database Connection

This is the most common error WordPress users face. If you are a WordPress user, you will probably face this error at least a hundred times in your lifetime.
When you see the error message “Error Establishing a Database Connection,” it simply means that WordPress couldn’t connect to your MySQL database server.

The most common reason for this problem is incorrect database login credentials. Maybe your password or the username is wrong.

To check if your password and username are right, edit your wp-config.php file and look for the following code:

define('DB_NAME', 'database_name’);
/** MySQL database username */
define('DB_USER', 'username');

/** MySQL database password */
define('DB_PASSWORD', 'password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

In the above code sample:

  • username is the username of the MySQL database user that has access to your WordPress database.
  • password is the password of the MySQL database user.
  • host is the address of the server that is hosting your database. Here’s a list of common MySQL hostnames.
  • database_name is the name of your WordPress database you are trying to access.

Check the database login credentials in your wp-config.php file and fix them if they are wrong. In most cases, this error shows up when the database login credentials are invalid.

But there are times when other things might be causing this error. One of those is that your database server isn’t responding. In that case, all you can do is contact your web host and ask them to fix the problem.

500 Internal Server Error

This error shows up when there was some sort of an error on the server but the server software wasn’t able to identify the exact error.

There are literally millions of reasons why you might be seeing this error. Maybe you installed a broken plugin or made some changes to the WordPress codebase.

Here are a few things you should try:

  1. Check Your .htaccess File (not available on Pressable)
    The .htaccess file is used to rewrite URLs and make them look pretty. The “pretty permalinks” option in the WordPress permalinks settings uses this file to make the URLs of your website look “pretty.”
    If your .htaccess file has been corrupted, your server will display the 500 internal server error.
    To know if your .htaccess file is creating the problem, you need to log into your FTP client or the File Manager app your web host provided and rename the .htaccess file to “.htaccess_backup”
    Once you rename the file, try opening the homepage of your website. If your website is now working, visit the permalinks settings page from your WordPress dashboard and click Save Changes.
  2. Switch To The Default Theme
    If you are seeing the 500 Internal Server Error message, then you probably can’t access the dashboard.
    If you can access the dashboard, visit the Themes section and change the theme to the default one that comes with WordPress.
    If you can’t access the dashboard or if you don’t have the default theme installed, login to your FTP client, navigate to the wp-themes folder, and rename the folder of your current theme to something else.
    This will force WordPress to switch to the default theme and in case you don’t already have the default theme, WordPress will download the default theme and install it.
  3. Deactivate All Your WordPress Plugins
    A corrupt or broken plugin might be the reason why you are seeing this error.
    If you don’t know which plugin is causing this problem, you will have to deactivate all your WordPress plugins.
    In most cases, if you are seeing this error, you won’t be able to access the WordPress dashboard. If you are able to access the Plugins page from your WordPress dashboard, disable all the plugins from there.
    On the other hand, if you can’t access the Admin area, login to your FTP client, and rename the plugins folder in wp-content folder.
    This will disable all the active plugins.

In some rare cases, the PHP Memory Limit can also be the cause. Checking with your host to ensure the WP_MEMORY_LIMIT is set to at least 64MB may help. Pressable sets ours to a very generous 512MB (info here).

White Screen of Death

This is the most dreaded error in the WordPress community because you don’t see an error message telling you why you are seeing this white screen.

Here are a few things you can try:

  1. Enable Debugging
    When you enable debugging in WordPress, WordPress will start displaying error messages that it would hide in a production environment. The reason why WordPress hides these error messages is because a hacker might misuse the information these errors offer.
    Once you enable debugging, you might see the real error.
    To enable debugging, look for the following line of code in your wp-config.php file:
    define(‘WP_DEBUG’, false);
    You will find this somewhere at the bottom of the file. Change false to true to enable debugging.
  2. Use The Default Theme
    If you are able to access the Dashboard, switch to the default theme. This is usually caused by broken themes.
    If you can’t access the Admin Dashboard, try the steps in the “500 Internal Server Error” section above.
  3. Disable All Plugins
    Plugins that try to alter the look of your website or your website’s Dashboard might cause this error.
    Disable all your plugins by following the instructions in the section above.
  4. Increase Memory Limit
    This is usually not the reason but try increasing the memory limit by following the instructions in the section above.

WordPress Sidebar Below Content

If your sidebar is showing up below your content instead the left or the right side (depending on your theme), then it can mean one of two things: either your theme has been corrupted or your html is invalid.

If your theme is corrupted, the best thing you can do is update the theme if an update is available or reinstall the latest version of the theme.

However, if the HTML code on your website is corrupted then you will have to fix the invalid code. This usually happens when you haven’t closed a <div>tag with a closing</div> tag.

To find out if this is really the case, open the webpage where you see this error, right click and click the “View Source Code” option.

It will show all the HTML code that your webpage is using. Copy this code, open this HTML Validation Checker tool, and paste the code in there to check if your HTML is valid.

If you see an error on that page, you will have to look for the file that has the invalid HTML code and fix the code in it. Unfortunately, every theme is different and has hundreds of files. You will have to look for the file and then look for the error causing invalid code by yourself. We cannot help you with that.

If your HTML code is valid and you are still seeing this error, your theme might be corrupted. Or your style.css file in the current theme might have some broken code. If the style.css file is broken, you will have to hire a developer to fix it.

Connection Timed Out

The connection time out error usually shows up when WordPress doesn’t have enough memory to play with. When this is the case, you will have to increase the memory limit in your wp-config.php file. To do this, place the following line of code at the end of your wp-config.php file:

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

If this doesn’t fix your error, try deactivating all the plugins and switching to the default theme. See instructions in the 500 Internal Server Error section above.

Forgot Admin Password

We are all guilty of forgetting the Admin password for our websites. Not just once but more than a thousand times. If this is happening to you, don’t panic.
It is really easy to reset the Admin password.

The easiest way to do it is through the Forgot Your Password link on the Login Page of your WordPress admin area.
If the Forgot Your Password feature offered by WordPress doesn’t work for you, login to PHPMyAdmin and select your WordPress site’s database:

Selecting the database in phpMyAdmin, an easy WordPress website fix.

Now, select the wp_users table from the list of tables:

Select wp_users, an easy WordPress website fix.

You will see all the users there are on your WordPress website (including You) as a database entry. Find your username among the list and click the Edit link to the left of the entry row:

Select edit, an easy WordPress website fix.

On the Edit page, you will see options to edit user_pass:

Change password, an easy WordPress website fix.

Just like in the above screenshot, select MD5 from the drop down and then input your new password in the value field.
Click the GO button at the bottom and login using your new password.

Pages And Posts Return a 404 Not Found Error

Your .htaccess file usually is the cause of this error. If you are seeing the 404 error on Posts and Pages, this means two things: you are probably using Pretty Permalinks and WordPress wasn’t able to edit the .htaccess file when you saved the settings.

In 99% of the cases, this problem goes away by simply clicking the Save Changes button on the Permalinks Settings page on your WordPress Admin dashboard. This will force WordPress to rewrite the new changes to the .htaccess file.

If that didn’t work, you will have to edit your .htaccess file and place the following code in it:


# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

The above code should make it work.

Stuck In Maintenance Mode After Update

This is a rare problem. If WordPress is going through the update process and for some reason is interrupted in the middle of it, you will see the Maintenance Mode message all the time on your website.

If this is the problem you are facing, simply delete the .maintenance file from your WordPress installation directory and visit your website. It fixes the problem most of the time.

Conclusion

We hope the above solutions worked for you. If they didn’t, you will have to find a web developer who can fix these errors.

If you’re looking for a managed WordPress hosting company with experience fixing common WordPress issues for you, then we hope you consider Pressable.

Zach Wiesman

Zach brings a wealth of knowledge to Pressable with more than 15 years of experience in the WordPress world. His journey in WordPress began with creating and maintaining client websites, fostering a deep understanding of the intricacies and challenges of WordPress. Later, his knack for problem-solving and commitment to service led him to pursue a role at Automattic, where he excelled in providing customer support for WooCommerce. His expertise extends beyond technical proficiency to encompass a deep understanding of the WordPress community and its needs. Outside of work, Zach enjoys spending time with his family, playing and watching sports, and working on projects around the house.