{"id":117730,"date":"2020-02-25T06:16:43","date_gmt":"2020-02-25T06:16:43","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-user-role-switcher\/"},"modified":"2026-06-18T16:06:56","modified_gmt":"2026-06-18T16:06:56","slug":"wp-user-role-switcher","status":"publish","type":"plugin","link":"https:\/\/dsb.wordpress.org\/plugins\/wp-user-role-switcher\/","author":15124511,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.2.4","stable_tag":"0.2.4","tested":"7.0","requires":"3.7","requires_php":"7.4","requires_plugins":null,"header_name":"WP User Role Switcher","header_author":"Dhanendran Rajagopal","header_description":"This plugin allows you to quickly swap between user roles in WordPress at the click of a button. You\u2019ll be instantly switched to the new user role. This is handy for test environments where you regularly log out and in between different accounts, or for administrators who need to switch between multiple accounts to test the feature in different user roles.","assets_banners_color":"111d2f","last_updated":"2026-06-18 16:06:56","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/dhanendran\/wp-user-role-switcher","header_author_uri":"https:\/\/dhanendranrajagopal.me","rating":5,"author_block_rating":0,"active_installs":100,"downloads":5261,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":{"0.2.0":{"tag":"0.2.0","author":"dhanendran","date":"2021-03-26 15:36:28"},"0.2.1":{"tag":"0.2.1","author":"dhanendran","date":"2021-03-26 15:47:08"},"0.2.2":{"tag":"0.2.2","author":"dhanendran","date":"2025-01-02 08:02:30"},"0.2.3":{"tag":"0.2.3","author":"dhanendran","date":"2026-06-17 16:53:31"},"0.2.4":{"tag":"0.2.4","author":"dhanendran","date":"2026-06-18 16:06:56"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3576205,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3576205,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256},"icon.svg":{"filename":"icon.svg","revision":3576149,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":3576161,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":3576161,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.2.0","0.2.1","0.2.2","0.2.3","0.2.4"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[237989,168751,1591,2461,11917],"plugin_category":[44,51],"plugin_contributors":[142850],"plugin_business_model":[],"class_list":["post-117730","plugin","type-plugin","status-publish","hentry","plugin_tags-role-switcher","plugin_tags-switch-user","plugin_tags-testing","plugin_tags-user-management","plugin_tags-user-roles","plugin_category-discussion-and-community","plugin_category-multisite","plugin_contributors-dhanendran","plugin_committers-dhanendran"],"banners":{"banner":"https:\/\/ps.w.org\/wp-user-role-switcher\/assets\/banner-772x250.jpg?rev=3576161","banner_2x":"https:\/\/ps.w.org\/wp-user-role-switcher\/assets\/banner-1544x500.jpg?rev=3576161","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/wp-user-role-switcher\/assets\/icon.svg?rev=3576149","icon":"https:\/\/ps.w.org\/wp-user-role-switcher\/assets\/icon.svg?rev=3576149","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin allows you to quickly swap between user roles in WordPress at the click of a button. You\u2019ll be instantly switched to the new user role. This is handy for test environments where you regularly log out and in between different accounts, or for administrators who need to switch between multiple accounts to test the feature in different user roles.<\/p>\n\n<h3>Features<\/h3>\n\n<ul>\n<li>Switch Role To: Instantly switch to any user role from the admin bar at top.<\/li>\n<li>Switch back: Instantly switch back to your originating role.<\/li>\n<li>Compatible with WordPress, WordPress Multisite, WooCommerce.<\/li>\n<\/ul>\n\n<h3>Security<\/h3>\n\n<ul>\n<li>Only users with the ability to edit other users can switch user roles. By default this is only Administrators on single site installations, and Super Admins on Multisite installations.<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<ol>\n<li>Once plugin is activated, you will see <em>Switch Role To<\/em> in the top admin bar.<\/li>\n<li>Clicking this will bring the list of user roles available in the system.<\/li>\n<li>Click on any user role you want to test as.<\/li>\n<li>You can switch back to your originating user role via the <em>Switch back<\/em> link on the top admin bar.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>0.2.4<\/h4>\n\n<ul>\n<li>[Security] Role switching now requires the <code>promote_users<\/code> capability (administrators \/ super admins) instead of <code>manage_options<\/code>, preventing a lower-trust custom role granted <code>manage_options<\/code> from self-assigning a higher role such as administrator.<\/li>\n<\/ul>\n\n<h4>0.2.3<\/h4>\n\n<ul>\n<li>[Security] Added a capability check to the role-switch handler so only administrators (or an already-switched user switching back) can switch roles.<\/li>\n<li>[Security] The \"Switch Back\" action now verifies its nonce before changing any roles.<\/li>\n<li>[Security] Escaped role-switch URLs and labels in the admin bar and floating button output.<\/li>\n<li>[Security] Hardened the post-switch redirect to a safe, local URL (no longer trusts the host header).<\/li>\n<li>[Fix] Replaced the deprecated <code>FILTER_SANITIZE_STRING<\/code> with core sanitization for PHP 8.1+ compatibility.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>[Improvements] Added floating action button when role is switched.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Instant switching between user roles in WordPress.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/117730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=117730"}],"author":[{"embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dhanendran"}],"wp:attachment":[{"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=117730"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=117730"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=117730"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=117730"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=117730"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/dsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=117730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}