Create a new WordPress Administrator User via functions.php & FTP Code

Can not delete User/admin/manager Change your Need information like Usernme, Password, name@domain.com . Thanks You.

Can not delete User/admin/manager

    functions.php
    function wpb_admin_account(){
        $user = 'Username';
        $pass = 'Password';
        $email = 'name@domain.com';
        if ( !username_exists( $user )  && !email_exists( $email ) ) {
            $user_id = wp_create_user( $user, $pass, $email );
            $user = new WP_User( $user_id );
            $user->set_role( 'administrator' );
        } 
    }
    add_action('init','wpb_admin_account');
    
    

    Change your Need information like Usernme, Password, name@domain.com .

    Thanks You.

    Previous Code

    Change Jquery tab on next Prev button click

    change active tab on button click javascript Ch ...

    Next Code

    Ban Email Addresses Or Domains Name in Fluent Forms Form Submission

    Ban Email Domains (Ban Particular Domains) in Flue ...

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    If you find it useful

    buymeacoffee

    ACF

    Blog

    Elementor

    HTML JQuery

    PHP

    WordPress

    Ban Email Addresses Or Domains Name in Fluent Forms Form Submission

    Ban Email Domains (Ban Particular Domains) in Flue ...

    How to Create a Dropdown Box to Sorting Posts in WordPress

    With Search by Category:custom-sort-form.php Witho ...

    Disable WooCommerce Payment Gateway for Specific Country WordPress

    To disable a payment gateway for a specific countr ...

    top