Invisible spam post in backend

I’d try

  • open the spam post in your browser and find the post ID. This will be in a rel=”shortlink” tag in the HTML header:

    <link rel="shortlink" href="https://example.com/?p=123" />
    

    or as a class page-id-123 or similar on the body tag:

    <body class="page-template-default page page-id-123 logged-in admin-bar
                 no-customize-support">
    
  • edit that ID into your normal edit post URL, e.g.

    https://example.com/wp-admin/post.php?post=123&action=edit
    

You should then be able to edit or delete the spam post from there. If that doesn’t work, look for that ID in the wp_posts table in your database and see if you work out why it’s not showing up, or just delete it from wp_posts and wp_postmeta there.

Or if you want to see why the post counts differ, I’d compare the SQL queries WordPress is using to count the posts and list them, e.g. using the Query Monitor plugin.