Dummy Data for WordPress
If you are a developer (regardless of what you develop), you know that testing your product out is one of the most important steps in the development process. Apart from running functionality tests you might also need to run scalability as well as compatibility tests and that’s where dummy data come in.
For WordPress you will most of the time need dummy data for posts, users or categories, things that take times to manually create. It is, therefore, much quicker and convenient if you have a tool to automatically generate those data. Fortunately there are some ready-made ones out there that can help you with such task and you will know more about them after reading this article.
The (possibly) easiest way to generate dummy data for WordPress is to use a plugin or any other tool that is designed specifically for WordPress because when you create a post, for example, you will also need some term relationships such as which categories the post belongs to or which tags the post is tagged with. As far as I know, there are two WordPress plugins that allow you to do this. Despite the fact that they are easy to use and designed for WordPress, I do not recommend using them at all… reason?
The first plugin is called WP Dummy Content and is located here: http://wordpress.org/extend/plugins/wp-dummy-content/. It is small and lightweight but is outdated and should only be used if you are still wandering around WordPress 2.5 to 2.8.3, which is not cool at all.
The second plugin is called Demo Data Creator (and Destroyer!!!) and is located here: http://wordpress.org/extend/plugins/demo-data-creator/. If you look at this plugin’s description and screenshot you will know that it is quite feature-rich but there are some features that can actually destroy your blog if you are not careful enough. If you have the time to read one of those support questions about this plugin1 (well you NEED to read it if you are planning on using this plugin), you might be shocked that this plugin can revert your website to null, i.e. no post, no comment, nothing. You will find no warning about such behaviour in the Description, Installation and FAQ tabs on this plugin’s official page, which is a very bad thing (now that I’ve warned you, be safe ;)).
I don’t know about you but I’m not going to use the two plugins above because there are safer and (probably) better ways to do it.
There are some generous folks out there offering downloads of their own dummy data for you to use. You can download some following this link: http://wpguerrilla.com/download/, and this link: Church Crunch Dummy Data. Don’t expect a lot of dummy data, though. Those were simply made with the sole purpose of testing a theme’s functionality or compatibility with actual data.
In case someone needs it, I have created a larger set of data that is available in the attachment section below or you can just click here to download. It gives you 10 categories with 100 posts each (1000 posts in total) and about 1000 pages. Posts and pages are tagged randomly with approximately 100 tags.
This set also comes with more than 2000 comments posted randomly into each post and page. Post contents are generated randomly using a Lipsum generator. Since this set has about 1000 pages, it is recommended that you do not use the default WordPress’s navigation menu as it will show all of them, which will simply flood your computer’s entire screen.
Those dummy data you download are designed to be imported directly into WordPress using an importer, which you can find easily on the admin menu (as shown in the screenshot to your right). Please note that you will need to install a small plugin called WordPress Importer (since WordPress 3.0 it is no longer built-in) for the importer to work. There’s a somewhat lengthy documentation page on WordPress.org guiding you through how to use that as well. For the large set of mine, it will take from approximately 10 to 15 minutes for the import to complete, so please be patient :).
Database query generation tool
If you are an experienced developers and you would like to have more control over the dummy data, you can generate some yourself using this online generator: http://www.generatedata.com/#generator. Using this generator requires some knowledge of WordPress’s database structure and you will also have to run all the SQL statements2 this generator gives you using phpmyadmin (or similar tools). Running SQL using phpmyadmin is easy and there’s a guide here if you want: [Tutorial] How to use phpMyAdmin.
A small note about the Data Type you can choose for a field: if you want that field to be empty rather than null (some wp_posts fields, for example, need to be empty otherwise an SQL error will occur), you will need to choose the Custom List data type and then leave all the Options fields blank.
This generator is overall good and can be very useful if you know how to combine queries to generate fully-featured dummy data. The only limitation (or a bug?) is you can’t generate more than 200 results in one run so you should keep that in mind too. Anyway I hope you find this article useful and happy flooding your WordPress with dummy contents!
- http://wordpress.org/support/topic/plugin-demo-data-cre ... do-not-use [↩]
- http://www.w3schools.com/sql/sql_intro.asp [↩]