WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to put in theme admin page an option for demo content XML.

This option should offer the possibility to switch between Demo Content and Default WordPress installation content. If I select demo, I want to show Demo content from my XML file. If select default I want to show what I have already posted, not the imported XML content.

share|improve this question

Sound like an interesting, but I think it would be very difficult, because content is more than just posts:

  • Post authors for the demo content must match existing users.
  • Taxonomies (tags, categories, nav menus) are bound to existing content.
  • Comments need proper associations with post IDs and post types.

One way to do what you want:

  • Create copies of the existing tables (posts, post_meta, comments, taxonomy tables) with a different prefix.
  • Filter query and replace the table names when you want to show the demo content.
  • During import, map existing users to the new content.

There are probably a billion ways how this can break. Multi-site and unusual database setups are obvious. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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