• Why I can′t create a new post in my wordpress?

    I have run into a problem where I can no longer create new posts on my WordPress site.

    When clicking on “Posts > Add new” I get a white page with this warning:

    Warning: Creating default object from empty value in /public_html/wp-admin/includes/post.php on line 748

    This is the line 748:

    $post->post_content = (string) apply_filters( 'default_content', $post_content, $post );

    I′ve tried:

    • Disabling all plugins
    • Updating WordPress (6.1.1)
    • Reinstalling WordPress by FTP
    • Checked the AUTO_INCREMENT box in phpMyAdmin for “wp_posts > structure > ID” and “wp_postmeta > structure > idmeta_id”

    Nothing fix the problem. Please, someone can help me? Thanks!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Disable display_errorson your site. You may need to look up information from your host how to do this.

    Thread Starter deboragida

    (@deboragida)

    Hi Samuel! thanks for your anwser! I have access to the CPanel or FTP. Can I modify the wp-config for “display-errors”?

    Thread Starter deboragida

    (@deboragida)

    I tried with “Disable display_errors in my site”, that work for hide the error, but not for solve the issue.

    It seems that the problem is not caused by a plugin conflict or corrupted core files.

    It’s possible that there is an issue with the database, specifically with the AUTO_INCREMENT value of the ID column in the wp_posts table or the idmeta_id column in the wp_postmeta table.

    Try to check the following:

    1. Ensure that the AUTO_INCREMENT value for the ID column in the wp_posts table is set to the next available number and not set to zero or any number that has already been used.
    2. Check if there is any table in the database that is corrupted. You can use a plugin like “WP-Optimize” or “Advanced Database Cleaner” to check and repair the corrupted table.
    3. Check if there is any problem with the permissions of the database user, check that the user has the correct permissions to create, update and delete posts.
    4. If the problem persists, consider contacting your hosting provider, they may be able to help you further troubleshoot the issue or can restore a backup of your site if they have one.

    More steps here > Fixing the ‘Creating default object from empty value’ Error in WordPress

    The variable $post is not an object in that line. WordPress couldn’t insert a new draft post in the database.

    Maybe missing insert permission to the database?

    Have you a problem for example uploading a media file also?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can′t create a new post: warning’ is closed to new replies.