====== LiteSpeed Cache for WordPress: Simulate Roles in Crawler ====== LSCache uses [[https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:crawler | 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. =====How to Set it Up ===== ==== 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. {{:litespeed_wiki:cache:lscwp:simu-1.png?400|}} Please see [[https://rudrastyh.com/wordpress/get-user-id.html | 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. {{:litespeed_wiki:cache:lscwp:simu-5.png?700|}} If you want to crawl additional roles, enter more userids, one per line. ===== Start Crawling ===== Follow the original [[https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:crawler#getting_ready_to_run | 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 {{:litespeed_wiki:cache:lscwp:simu-4.png?700|}}