Early access pricing available
Visit pricing
BricksBee | Components & Templates for Bricks Builder

BricksBee

For Bricks Builder
Quick sign up
Create account less than 30 sec with Google

Remove Admin Role Injections | WordPress

demo of prevent admin role injection
Demo of prevent admin role injection

This is a super simple code snippet that provides an additional level of security against unexpected admin roles on your WordPress websites. Let’s see how it works.

Problem: In WordPress, I see random admin roles.

You might have seen such a picture on your WordPress page with Admin users:

screenshot

Some guy injected himself into your WordPress system, even though you have firewall plugins, which unfortunately aren’t perfect.

Solution: Prevent and automatically delete newly created or injected roles.

When you paste this code snippet into functions.php or as a separate snippet, you can try to inject or create a new user with the admin role. This snippet will prevent this action, and no one will have a chance to control your WordPress project from the inside.

screenshot

🔴 Important: installation process. Follow this guide

  1. Find your userID for your existing admin roles. Open admin role card, check URL.
    Example: https://yourwebsite.com/wp-admin/user-edit.php?user_id=4.
    In this case, the userID is 4
  2. Paste all these IDs via comma in this part of the code.
    Example: (in_array ($user_id, [2, 5, 7, 14691,))
  3. Activate your snippet

Here are places where you have to add IDs:

screenshot
screenshot

That’s it! Scroll to the top and check the demo.

Note: If you want to add more admin roles, please deactivate this snippet, add new users with admin roles, and then activate the snippet.

Want this snippet?
You have to buy All-in-One KING package
Sign up for free & Buy KING plan
See pricing & Sign up

Other snippets & plugins

change wordpress welcome email with BricksBee code

Change WordPress Welcome Email which goes to Inbox

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
all in one crown
KING
Buy now feature for woocommerce. Add to cart element in Bricks Builder

Buy now for Woocommerce

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
all in one crown
KING
Secure Downloads for Cloud Links

Secure Downloads for Cloud Links

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
all in one crown
KING
bricksbee role changer

WordPress User Role Changer Plugin

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!

Latest components

pro crown
PRO
BB | Dynamic Island Progress View

BB | Dynamic Island Progress

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
hamster bricks builder game

BB | Catch Hamster

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
pro crown
PRO
dockmenu component for Bricks Builder

BB | Dock menu

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
pro crown
PRO
BricksBee: quick links widget components

BB | Quick Links Widget

The most famous tech-brand ever tested our services to get a high-qualuty website for Beta testers. Thanks, Apple!
Check all components

Unlock more features!

Components & Templates
What you need for Bricks improvements
Quick sign up
Create account less than 30 sec with Google