Title: Issue when importing posts
Last modified: June 29, 2026

---

# Issue when importing posts

 *  Resolved [JLBA](https://wordpress.org/support/users/jltest/)
 * (@jltest)
 * [6 days, 16 hours ago](https://wordpress.org/support/topic/issue-when-importing-posts/)
 * Hi everyone,
 * I used export/import function in WP to import posts (not pages) from one instance
   to a test instance. During import, I had a 504 error. The second import went 
   to its end and displayed a list of posts or attachments already imported (so 
   not reimported ?).
 * **But no posts are displayed in backoffice Posts. **In MySQL, I can request the
   posts with post_type = “post” in wp_posts so they do exist. What could be the
   problem ? Can I suppress them manually ? What about links with other tables like
   wp_postmeta, wp_terms, wp_termsmeta, wp_term_relationships, wp_term_taxonomy ?
 * Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 days, 15 hours ago](https://wordpress.org/support/topic/issue-when-importing-posts/#post-18951347)
 * I don’t know what the problem might be, but I can suggest a direction for further
   investigation that might reveal the root cause of the problem. If no posts show
   in the back office, it’s because the related SQL query found no posts matching
   the query. Examine the actual SQL query by using the Query Monitor plugin.
 * With the plugin active, navigate to the posts list table. In the admin bar, click
   the timing data, which reveals a menu. Select Database Queries. In the Queries
   box, alter the Caller filter to be `WP_Query->get_posts()`. The correct query
   will be the one whose Rows value matches the number of posts per page you have
   set for the posts list table, such as `20` for example (assuming you have more
   than one page’s worth of posts on your site).
 * The default query only matches post type “post” AND a variety of post status 
   values such as “publish”, “draft”, etc. If you have any other WHERE criteria 
   in your query (besides the usual `1=1`), it’s likely added by a plugin or theme
   and could be the reason nothing was found. There might not be anything wrong 
   with your database.
 * If you appear to have just the default query, then your posts table may not have
   the correct post status values.
 * You might wonder what’s up with this `1=1` criteria. It’s so WP can add additional
   AND criteria without needing to check if there’s already another criteria to 
   AND against. The `1=1` will almost always be there. If instead of `1=1` you have
   a `1=0`, then the query will always fail. It’s an indication that WP was unable
   to properly parse the request. In such a case, be sure your request URL is correct.
   If so, it’s likely a theme or plugin is causing a conflict.
 *  Thread Starter [JLBA](https://wordpress.org/support/users/jltest/)
 * (@jltest)
 * [6 days, 12 hours ago](https://wordpress.org/support/topic/issue-when-importing-posts/#post-18951433)
 * Hi [@bcworkz](https://wordpress.org/support/users/bcworkz/) ,
 * Thanks for your answer. I thought I had answered to myself as I found the solution
   but my message wasn’t sent. The reason was all posts were in trash with draft
   status. Why . I don’t know. But I could restore and publish them and everything
   is now ok.
 * Glad to discover Query monitor which seems a very useful tool.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fissue-when-importing-posts%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

## Tags

 * [Import](https://wordpress.org/support/topic-tag/import/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [JLBA](https://wordpress.org/support/users/jltest/)
 * Last activity: [6 days, 12 hours ago](https://wordpress.org/support/topic/issue-when-importing-posts/#post-18951433)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
