{"id":7033,"date":"2017-04-05T11:14:10","date_gmt":"2017-04-05T11:14:10","guid":{"rendered":"https:\/\/jsmwebsolutions.com\/blog\/?p=7033"},"modified":"2017-04-05T11:14:10","modified_gmt":"2017-04-05T11:14:10","slug":"add-admin-user-wordpress-using-ftp-add-new-admin-wordpress-function-php-file","status":"publish","type":"post","link":"https:\/\/jsmwebsolutions.com\/blog\/add-admin-user-wordpress-using-ftp-add-new-admin-wordpress-function-php-file\/","title":{"rendered":"How to Add an Admin User in WordPress using FTP or how to add new admin in wordpress from function.php file"},"content":{"rendered":"<p>\n\tHow to Add an Admin User in WordPress using FTP or How to add new admin in wordpress from function.php file\n<\/p>\n<p>\n\t&nbsp;\n<\/p>\n<h4>\n\tIts very easy to add admin from phpmyadmin but you can also add admin in wordpress from function.php file<br \/>\n<\/h4>\n<h4>\n\tAdding an Admin User in WordPress Using FTP<br \/>\n<\/h4>\n<p>\n\tFirst thing you will need is an FTP client. If you are new to using FTP, then see our guide on how to use FTP to upload files in WordPress.\n<\/p>\n<p>\n\tOnce connected to your WordPress site, you need to locate your WordPress theme&rsquo;s <span style=\"color:#FF0000;\">functions.php<\/span> file. It would be at a location like this:\n<\/p>\n<p>\n\t<code>\/yoursite.com\/wp-content\/themes\/your-active-theme\/functions.php<\/code>\n<\/p>\n<p>\n\tRight click on <code>functions.php<\/code> file and then select download. Your FTP client will download the functions.php file to your computer.\n<\/p>\n<p>\n\tOpen the file you just downloaded on your computer using a plain text editor like Notepad or in dreamviver. Now you need to add this code at the bottom of the file.\n<\/p>\n<p>\n\t####################<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;function wpb_admin_account(){<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$user = &#39;Username&#39;;<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$pass = &#39;Password&#39;;<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$email = &#39;email@domain.com&#39;;<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;if ( !username_exists( $user )&nbsp; &amp;&amp; !email_exists( $email ) ) {<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$user_id = wp_create_user( $user, $pass, $email );<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$user = new WP_User( $user_id );<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;$user-&gt;set_role( &#39;administrator&#39; );<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;} }<br \/>\n\t&nbsp;<br \/>\n\t&nbsp;&nbsp; &nbsp;add_action(&#39;init&#39;,&#39;wpb_admin_account&#39;);\n<\/p>\n<p>\n\t####################\n<\/p>\n<p>\n\tDon&rsquo;t forget to replace Username, Password, and email@domain.com with your own values.\n<\/p>\n<p>\n\tNext, save the file and then upload it back to your website using the FTP client.\n<\/p>\n<p>\n\tAll done now you can login with these details into admin sectin of wordpress<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Add an Admin User in WordPress using FTP or How to add new admin in wordpress from function.php file &nbsp; Its very easy to add admin from phpmyadmin&hellip;<\/p>\n","protected":false},"author":1,"featured_media":7035,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7033","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-responsive-websites"],"rttpg_featured_image_url":{"full":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false],"landscape":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false],"portraits":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false],"thumbnail":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP-150x150.jpg",150,150,true],"medium":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP-300x225.jpg",300,225,true],"large":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false],"1536x1536":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false],"2048x2048":["https:\/\/jsmwebsolutions.com\/blog\/wp-content\/uploads\/2017\/04\/Adding-an-Admin-User-in-WordPress-Using-FTP.jpg",480,360,false]},"rttpg_author":{"display_name":"Aj","author_link":"https:\/\/jsmwebsolutions.com\/blog\/author\/admin\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/jsmwebsolutions.com\/blog\/category\/responsive-websites\/\" rel=\"category tag\">Responsive Websites<\/a>","rttpg_excerpt":"How to Add an Admin User in WordPress using FTP or How to add new admin in wordpress from function.php file &nbsp; Its very easy to add admin from phpmyadmin&hellip;","_links":{"self":[{"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=7033"}],"version-history":[{"count":1,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7033\/revisions"}],"predecessor-version":[{"id":7034,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7033\/revisions\/7034"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/media\/7035"}],"wp:attachment":[{"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jsmwebsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}