0

I have been developing my WordPress site on a development local server.

I would now like to move the site to my production server.

I don't need any of the dummy data that I have generated while testing on my development server (posts, users, etc.). However, I do need anything that has to do with the design of the website (pages, widgets, etc.).

Originally, I tried simply clearing all tables in the database that weren't wp_options. However, I noticed that there are rows in wp_posts (eg: post_type: page), wp_postmeta, wp_term_relationships and wp_term_taxonomy that aren't related to user generated content like posts but rather with the display of the site.

Are there any simple, recommended ways to go about clearing all of this "non-display" data from my database?

Possible approaches:

1) Delete directly from my database with the help of inner joins (where post_type equals "page" or "nav_menu_item" or "attachment").

2) Use the Dashboard to delete posts, users and comments.

1

There are plugins that will do this for you (example). Whether it's worth installing it and learning how to use it, depends on how many posts, pages and so on, you have.

If you have less than, say, a hundred you can use the screen options tab on posts, pages and users to select a high enough number to be shown on one page. Then simply select all and trash. This also works for media in the list mode (rather than default grid mode with infinite scroll).

I wouldn't mess with the database for this. Unless you really have a lot of data to wipe that would be too time consuming to figure out for a one off job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.