WordPress doesn’t show all posts in database

Are you sure those aren’t pages, drafts, trashed, revisions or attachments? To make sure that those aren’t such, run the following in

  • phpMyAdmin (Query tab – field “SQL query on database [database name]:”)
  • Adminer
  • In the terminal

and see how many results you get:

select * from wp_posts where post_status="publish"