LiteSpeed Cache for WordPress: Simulate Roles in Crawler

LSCache uses Guest View by default, which means that it crawls from the point of view of a non-logged-in user. It is possible to simulate additional user roles in the crawler, which is useful if you have a site where the logged-in view differs from the logged-out view, or there are multiple different views based on user role.

Get User ID

To simulate the experience of a particular user role, you will need to find a user that has that role and get their userid. For example, if you want to crawl an Editor view, find a user who is listed as an Editor, and find their userid.

There are several ways to find a WP userid. One way is to navigate to Wordpress Dashboard > Users, and hover over the Edit link next to a user's gravatar. The URL that displays on the bottom left of the browser screen will contain a string that looks like ?user_id=XXX, where XXX is the userid.

Please see 7 methods to get User ID, if you want to try another way.

Add User ID to Role Simulation

Assume we get a userid of 3. Then we enter 3 in the LiteSpeed Cache > Settings > Crawler > Role Simulation box.

If you want to crawl additional roles, enter more userids, one per line.

Follow the original Getting Ready to Run instructions, to generate a crawler file and start crawling.

In our example, you will see there are two roles to crawl: Guest and Editor

  • Admin
  • Last modified: 2018/09/06 20:58
  • by Lisa Clarke