Joshua F. Rountree
Joshua F. Rountree

Reputation: 1482

WordPress: Posts / Pages list not showing in wp-admin panel

I have somewhat caused a weird issue. I moved a client to a different server. Upgraded wordpress + database. Little did I know, I was actually updating the database on the previous server due to the config having a hardcoded mysql IP address.

So I resolved that in the config, then it asked to update the database.

Now it doesn't show posts / pages in admin but the counts still show up in the "All" "Published" links.

Is there a bit or "status" that didn't get set in the database update? Something that is preventing these from showing in admin.

They show up fine on the front webpage.

Any help would be appreciated!

UPDATE: Created a new post after upgrade and the count increased to 13 but still says "No Posts". :-\

UPDATE: Links & Comments both show up with a huge list. Posts, Pages, and Media do not show up.

Maybe this has to do with the post_author index they WordPress added? I verified the user existed with matching ID. :-\ Example Screenshot Example Screenshot 2 Example Screenshot 3

Upvotes: 1

Views: 39984

Answers (10)

Simon K
Simon K

Reputation: 1

When migrating a site to a new server, I used phpMyAdmin to export the db and import it on the new server. Some of the tables had date fields with a default value of 0000-00-00 00:00:00. Eventually I discovered that when those values were exported they caused import errors. In particular, adding a db index to the table failed because this is an invalid date-time. My fix / workaround was to edit the exported sql to change all instances of that string to 2001-01-01 00:00:01 (which was a date several years before any actual entries); delete (i.e. drop) all the tables on the new server, and reimport them. Then everything worked. The data imported, the indexes were created, and no blank pages or posts missing in the "all posts" edit.php page.

Upvotes: 0

Surrogacy Georgia
Surrogacy Georgia

Reputation: 21

In my case, I was using Poly Lang and was selected the Arabic language to show only and after switching to all problem solved.

Upvotes: 2

Jeremy
Jeremy

Reputation: 3809

WordPress runs the following query to populate the post page in admin:

SELECT wp_posts.ID, wp_posts.post_parent FROM wp_posts  
WHERE 1=1  AND wp_posts.post_type = 'article' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'virtual' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')  
ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC 

I used this and found out during a data transfer that the post_status was set to 'published' instead of 'publish' which caused no articles to show despite showing a count.

Upvotes: 1

joesmo
joesmo

Reputation: 1

I had a similar issue and this is how I solved it: in the wp_posts table, I found out that the colums post_ENGINE and post_mime_ENGINE should rather be post_type and post_mime_type. I changed it and pages and posts are now showing in the admin panel. I don't know if my problem is the same but I hope it helps.

Instance where column names are post_ENGINE and post_mime_ENGINE

Instance where column names are changed to post_type and post_mime_type

Upvotes: 0

heni1022
heni1022

Reputation: 11

In my case deactivating "WPML Media" plugin fixed the problem.

Upvotes: 1

szk5
szk5

Reputation: 3

I had this same problem, I read Travis's comment and starting looking through my functions.php. Turns out query_posts() was causing the issue. To fix this, I added wp_reset_query(); after I was done retrieving data from my query.

Upvotes: 0

johnny_n
johnny_n

Reputation: 75

It's the old standby, but deactivate your plugins one by one and see if the posts come back. It's such an odd problem that I couldn't imagine it was a plugin issue (posts disappearing in the admin?), but it was for me -- I discovered it after all sorts of database gymnastics, etc. My guess is the new server has a more recent version of php and that's what's causing the issue, but oddly it wasn't throwing a visible error (even in the logs).

Upvotes: 1

Travis
Travis

Reputation: 11

I had the same issue and it had to deal with the functions.php file. Make sure there are no mistakes there and try reuploading. You may also try using another theme to see if the problem persists.

Upvotes: 1

Ben Maden
Ben Maden

Reputation: 61

We had exactly the same issue but only on the Pages in the website.

Steps to fix...

  1. Edit wp-config.php to add

    define('WP_ALLOW_REPAIR', true);
    
  2. Hit the database repair URL

    HOSTNAME/wp-admin/maint/repair.php
    

RESULT

My database was a bit messed up and so I got the following output...

    wp_usermeta: 5 clients are using or haven't closed the table properly
    wp_posts: 7 clients are using or haven't closed the table properly
    wp_options: 8 clients are using or haven't closed the table properly
    wp_postmeta: 7 clients are using or haven't closed the table properly
    wp_terms: 1 client is using or hasn't closed the table properly
    wp_term_taxonomy: 3 clients are using or haven't closed the table properly
    wp_term_relationships: 3 clients are using or haven't closed the table properly

Upvotes: 6

Marty
Marty

Reputation: 4657

best thing to do, if its still possible, is on the old server, do an export from within your tools admin menu,

on the new server do a fresh install, and do an import using the same method, once wordpress downloads and activates the plugin for the import just upload your wordpress file, during the import assign the users to either current users or just re-create them, then tick the box to import all attachments...

I've had this happen a few times when trying to move servers, some things in the database just get mixed up, but from previous experience, doing the export/import saved a lot of time..

Upvotes: 1

Related Questions