Image default
Themes

How to Add Dummy Content for Theme Development in WordPress

When we’re developing new plugins, creating tutorials, or testing code snippets, we often need to set up demo sites quickly. But let’s face it: building an entire website’s worth of content from scratch is time-consuming. You might be facing this same problem, too.

There are times when you need a fully fleshed-out site to work with, but don’t have the time to create all that content yourself. That’s where dummy content comes in handy.

This article will show you how we easily add dummy content to WordPress for theme development, plugin testing, or any other scenario where you need a populated site fast. We’ll show you 2 simple methods that have saved us tons of time.

What Is WordPress Theme Unit Test Data?

WordPress theme unit test data is an XML file containing theme demo content for testing and development purposes.

It is maintained by WordPress.org’s theme review team, which also uses it to test themes submitted to the WordPress.org theme directory.

You can use this WordPress dummy data generator to easily generate blog posts and pages, import images, and more. You may find this dummy data useful if you want to:

We regularly use this WordPress dummy content generator during our WordPress hosting reviews, where we test actual hosting accounts for performance.

In this tutorial, we will cover two beginner-friendly methods to add dummy content to WordPress. You can use the quick links below to jump to the method you want to use:

Method 1: Adding Dummy Content Using WordPress Theme Unit Test Data

First, you need to go to the Theme Unit Test project on GitHub and then click on the ‘Code’ button to download the zip file to your computer.

After downloading the file, you need to unzip it to your computer. It will extract the files in a folder called ‘theme-unit-test-master’.

Inside this folder, you’ll find three files, including the ‘themeunittestdata.wordpress.xml’ file, which contains all the dummy data that we need.

Now that you have the dummy data file, you can import it into any WordPress website.

Ideally, you will want to import it into a test site on your computer running a local server. You can also do the testing by creating a staging WordPress site.

Simply log in to the WordPress admin area on your test site and then go to the Tools » Import page. From here, scroll down to the WordPress importer option and then click on the ‘Install Now’ link.

Once the importer is installed, WordPress will automatically activate it.

You now need to click on the ‘Run Importer’ link to launch it.

On the next screen, you need to click on the ‘Choose File’ button.

Then, just select the Theme Unit Test XML file you downloaded earlier.

Now click on the ‘Upload file and import’ button to continue.

WordPress will now examine your import file attachments and ask whether you want to import the existing authors or assign their articles to another user on your site.

You can choose to import authors, and WordPress will create dummy user accounts for those authors. You can also assign the imported content to an existing user on your site.

Lastly, you can check the box to import attachments. Doing this will allow WordPress to download and store the images in your WordPress media library.

Finally, click on the ‘Submit’ button to run the importer.

The dummy data will now be imported into your WordPress blog or site. You’ll see a success message when it is finished.

You can now visit your website to see the imported content in action.

What’s Included in the Theme Unit Test Data?

Everything that you will need to test your WordPress theme is packed in theme unit test data.

It has categories, child categories, menu items, nested comments, pages, sub-pages, images of different sizes, image alignment, and more.

There are also lists, blockquotes, links, code, and other HTML tags that you should style in your themes.

If you are using the block editor, the test data comes with cover blocks, buttons, galleries with various layouts, columns, and other common blocks that you may want to test.

It is a comprehensive set of dummy data which is far better than using a dummy content generator plugin for WordPress.

Method 2: Generate Dummy Data in WordPress Using a Plugin

If you want more control over how much dummy data you generate, then you may want to use a dummy data generator plugin for WordPress.

First, you need to install and activate the FakerPress plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the FakerPress » Posts page from your WordPress dashboard to generate dummy posts.

The plugin allows you to generate posts and pages as well as any custom post types.

First, you need to select a range of posts you want to generate.

After that, you can select the date range, post type, author, and other options. You can also choose to import images from dummy placeholder image sources, use HTML inside your posts, and set the number of comments for each item.

If you scroll down, you can be more specific about how many paragraphs the posts should have, what HTML tags they include, and the excerpt size.

Once you are satisfied, simply click on the ‘Generate’ button at the bottom.

The plugin will now generate dummy content for WordPress using the settings you provided. You can now visit your site to see it in action.

FakerPress also allows you to easily generate dummy WordPress comments, add dummy user accounts, or create categories, tags, and other custom taxonomy terms.

Learn More About WordPress Theme Development

We hope this article helped you learn how to easily add dummy content for theme development in WordPress. You may also want to see our ultimate list of the best free WordPress themes and our guide on how to choose the best premium WordPress theme for your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Related posts

How to Add Numeric Pagination in Your WordPress Theme

admin

How to Add Custom Styles to WordPress Widgets (2 Ways)

admin

How to Remove the Sidebar in WordPress (6 Easy Methods)

admin

Leave a Comment