Warning: Creating default object from empty value in post.php

How to Fix WordPress “Warning: Creating default object from empty value in post.php”

Being stuck in WordPress when you try to create a new blog post can be frustrating. Fortunately, there are several ways to solve this issue. Take a look at this article as we’ll uncover how to solve the WordPress Warning in post.php issue using three simple methods.

Three Ways to Fix WordPress creating default object from empty value in post issue

Method 1: Deactivating Themes and Plugins

Conflicting or corrupted plugins is another common culprit of the WordPress login redirect loop issue. Therefore, you need to deactivate the faulty plugin.

Here’s how to troubleshoot the login redirect loop issue by deactivating your WordPress plugins:

  1. Access your website’s wp-content directory using an FTP or a File Manager.
  2. Rename the plugins folder to something else to deactivate all plugins. If this action solves the issue, that means you have a corrupted plugin. What we need to do now is to find the exact culprit.

    File Manager
    File Manager
  3. Change the plugins folder to its original name. This way, WordPress can reaccess your plugins, but all of them are still inactive.
  4. Login to your WordPress dashboard and head over to Plugins -> Installed Plugins. Activate all plugins.
  5. Logout from WordPress, and go back to your File Manager.
  6. Open the plugins directory, and disable the plugins one by one by renaming the corresponding folders. Each time you disable a plugin, try to login to your site and keep doing that until you find the one that causes the issue.

Similarly, a faulty custom theme can also disrupt your access to wp-admin. To confirm this suspicion, you need to revert the site to the default WordPress theme — twentytwenty.

Method 2: Re-install WordPress

You can do it right from your WordPress dashboard. It’s surprisingly simple. In your WordPress dashboard, go to Dashboard → Updates in the sidebar. Then, click the button to Re-install Now:

WordPress dashboard updates area
WordPress dashboard updates area

Once you click the button, WordPress will automatically download and reinstall the latest version of WordPress. You’re essentially just manually re-running the normal Update process that WordPress performs when you update WordPress from your dashboard.

It might take a few seconds – but once the process finishes, you should have a fresh copy of WordPress installed.

Method 3: Repair MySQL Database

If you go to PHPMyAdmin, and select your database, a crashed table will stand out from the others all will say “in use”. If you click on the table, an error message will be shown, notifying that the table “is marked as crashed and should be repaired”.

phpmyadmin
phpmyadmin

To repair a crashed table, you need to select the table that has crashed, and then select the “Repair Table” option.

Conclusion

WordPress “creating default object from empty value in post.php” is not a common issue that can happen to anyone. Fortunately, you can easily solve this error by deactivating Themes and Plugins, Re-install WordPress, and repair MySQL database.

Do you find this tutorial helpful? Let us know in the comments section below!


Comments

Leave a Reply

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