Knowledgebase

Auditing Content with Queries Print

  • databasesphpmyadmin, databases, migration, wordpress, database, woocommerce, guide, howto
  • 0

Understanding what your site actually contains.

USEFUL AUDITS

How many published posts, pages and products How many drafts How many revisions How many users, by role How many orders, by status How many comments, by status

WHY

Before a migration, so you can confirm nothing was lost Before cleanup, so you know the scale For reporting To find what is consuming the database

THE PATTERN

SELECT post_type, post_status, COUNT(*) FROM wp_posts GROUP BY post_type, post_status;

That single query gives you a complete picture of a WordPress site's content in one result.

It usually reveals that revisions outnumber actual content by a large factor.

FOR USERS

Counting by role requires joining usermeta, since roles are stored there.

AFTER A MIGRATION

Run the same audit on both source and destination. The numbers should match.

That is the practical check that catches a truncated import.

RECORDING IT

Note the figures periodically. Change over time is informative.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot