Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.

I created a small WordPress plugin you can use to export all your core WordPress data to JSON formatted file.

Exported data includes:

  • Posts (status: publish, private, draft)
  • Pages (status: publish, private, draft)
  • Attachments (media)
  • Comments (approved)
  • Tag definitions
  • Category definitions
  • Users

The file is generated in /wp-content/export.json in your WordPress site (note: it will be available for anyone to access).

Simple create a new page in your site, add the shortcode and run the page to generate the file.
I suggest removing the page and deleting the export.json once you’re finished with it.
This is just intended as a quick and easy way of exporting your site data to a JSON file.

Note: It may degrade performance or result in a page timeout for large sites.

Complete plug-in source code at https://gist.github.com/jsnelders/fd22ebc26530468125ffed2d5d1eb279.

Feel free to adapt the script as needed.