Why can't I create new posts in Wordpress? Warning: Creating default object from empty value in /public_html/wp-admin/includes/post.php on line 716


Staff member
I have run into a problem where I can no longer create new posts on my Wordpress site.
I think this started after a Wordpress update a while ago. I also have problems uploading images and I see ghost comments (an icon about new comments but no comments actually showing up in the list).
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 716"
This is line 716:
    $post->post_content = (string) apply_filters( 'default_content', $post_content, $post );
After searching online I think these issues are related to my database. I'm new to dealing with databases, so I'm hoping to maybe be able to get some help here.
<strong>Things I've tried:</strong>
<li>Using a standard theme</li>
<li>Disabling all plugins</li>
<li>Updating Wordpress</li>
<li>Downgrading to Wordpress 4.0</li>
<li>Repairing the database tables</li>
<li>Running health check I found out that the SQL is old
(5.5.52-MariaDB-cll-lve). Could this be relevant?</li>
<li>Checked the AUTO_INCREMENT box in phpMyAdmin for &quot;wp_posts &gt; structure &gt; ID&quot; and
&quot;wp_postmeta &gt; structure &gt; idmeta_id&quot;</li>
The auto_increment helped remove the error, but instead it caused some new problems. I activated it and could click &quot;Posts &gt; Add new&quot;. However, Wordpress created multiple copies of the same post, around fifteen posts instead of just one. I trashed them and tried to create a new post, but it still remembered the trashed post and tried to recreate a new post from the post in the trash.
<strong>Links I've checked and tried:</strong>
<li><a href="https://wordpress.org/support/topic...ty-value-of-line-639-wp-adminincludespostphp/" rel="nofollow noreferrer">https://wordpress.org/support/topic...ty-value-of-line-639-wp-adminincludespostphp/</a></li>
<li><a href="https://wordpress.org/support/topic/shoud-wp_posts-id-and-wp_post_meta-meta_id-be-auto_increment/" rel="nofollow noreferrer">https://wordpress.org/support/topic/shoud-wp_posts-id-and-wp_post_meta-meta_id-be-auto_increment/</a></li>
<strong>I feel like this could be relevant as well, but I'm not sure how to make use of it:</strong>
<li><a href="https://wpindexfixer.tools.managedwphosting.nl/" rel="nofollow noreferrer">https://wpindexfixer.tools.managedwphosting.nl/</a></li>