This will open the Create Custom Snippet page, where you can add the necessary code. You can start by adding a title for the snippet, such as “Bypass access restrictions for some users”.
Now, copy the code snippet below and paste it into the “Code Preview” box:
1-click Use in WordPress
Now look at the line that starts with $allowed_users = array. You need to replace '1, 2, 3, 4, 5' with the user IDs of the specific users you want to bypass the restriction. You can add any number of user IDs, separated by commas.
To learn how to find a user ID, see our guide on how to find posts, categories, tags, comments, or user IDs in WordPress .
Finally, you need to set the snippet to “Active” and then click the “Save Snippet” button to store your settings.
Code Snippet so Certain Users Bypass Login Restrictions
Bypass access restrictions for some roles
You can follow the same procedure to add a code snippet to bypass access restrictions for some roles.
Simply create a new code snippet called “Bypass access restrictions for some roles” and paste the following hungary telemarketing data code snippet into the “Code Preview” pane:
1-click Use in WordPress
This snippet bypasses the restriction for “administrator” and “editor” roles. You can add any other roles, such as “author”, in single quotes and separated by commas.
Make sure to toggle the snippet to “Active” and click the “Save Snippet” button when finished.
Code Snippet so Certain Roles Bypass Login Restrictions
We hope this tutorial has helped you understand how to limit user logins to one device in WordPress. You may also want to check out our ultimate guide to creating a membership site in WordPress or our expert picks for the best WordPress LMS plugins .
If you enjoyed this article, please subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook .