<- Test Directory

WordPress Load Test Example

Load test a WordPress based Blog or CMS with automatic crawling


Load testing (aka stress testing) your WordPress Blog or CMS is made extremely easy by LoadForge, and you can test it with a free account today. We are going to be showing how to simulate a real set of users, browsing through your latest blog posts at random.

We have a full WordPress load testing guide available as well.

The nicest feature about this test is that it will automatically crawl valid URLs and then request them like a real user, at random. This can be applied to many types of tests.


from locust import HttpUser, task, between
from pyquery import PyQuery
import random

class QuickstartUser(HttpUser):
    wait_time = between(5, 9)

    def index_page(self):
        r = self.client.get("/blog/")
        pq = PyQuery(r.content)

        link_elements = pq(".blog-list-post h2 a")
        self.blog_urls = []

        for l in link_elements:
          if "href" in l.attrib:

    def on_start(self):

    def static_content(self):
        # images
        # styles
        # scripts

    def blog_post(self):
        url = random.choice(self.blog_urls)
        r = self.client.get(url)

    def home_page(self):

This guide is part of the LoadForge Directory, an index of locustfile's for use with LoadForge website and API load tests. We also provide a wizard to generate tests, and onboarding assistance for clients. Contact us should you have any questions.

LoadForge provides load testing and stress tests for websites, APIs and servers. It uses your cloud account to rapidly scale large numbers of simulated users to load test your website, store, API, or application for cheap - just cents per test!

For more help on Tests please see our official documentation. Logged in users can also use our wizard to generate a locustfile, or you can record your browser steps.

Ready to run your test?
Start your first test within minutes.