{"id":5639,"date":"2022-07-12T17:29:25","date_gmt":"2022-07-12T11:59:25","guid":{"rendered":"https:\/\/phpyouth.com\/blog\/?p=5639"},"modified":"2026-01-19T14:39:56","modified_gmt":"2026-01-19T09:09:56","slug":"create-wordpress-admin-user-through-ftp","status":"publish","type":"post","link":"https:\/\/phpyouth.com\/blog\/create-wordpress-admin-user-through-ftp\/","title":{"rendered":"Create WordPress Admin User Through FTP"},"content":{"rendered":"<p>Hello friends, Today in this article, we will learn how to create WordPress admin users through FTP. FTP will help us to create a WordPress Admin User when we don&#8217;t have any other access. You can explore our <strong><a href=\"https:\/\/phpyouth.com\/blog\/ftp-tutorial\">FTP tutorial<\/a><\/strong> if FTP(File Transfer Protocol) is a new thing to you.<\/p>\n<p>A few days back, one of my friends asked me if it is possible to create an admin user without Database or WordPress Admin access. I said Yes, of course, it is possible. Actually, sometimes users forget their username\/password, or some security plugins lock users.<\/p>\n<p>We can also add an <strong><a href=\"https:\/\/phpyouth.com\/blog\/add-an-administrator-from-wordpress-mysql-database\">Admin user in WordPress through MySQL<\/a>, <\/strong>but today we will learn how to create an Admin user through FTP. So let&#8217;s start.<\/p>\n<h2>Creating an Admin User in WordPress Through FTP<\/h2>\n<p><strong>Step 1.<\/strong>\u00a0 First<span style=\"box-sizing: border-box;\">, you need to connect your FTP client; refer to this\u00a0<a href=\"https:\/\/phpyouth.com\/blog\/ftp-tutorial\" target=\"_blank\" rel=\"noopener\">tutorial<\/a> for instructions on how to do so<\/span>.<\/p>\n<p><strong>Step 2.<\/strong>\u00a0 Once you are connected to FTP, download the website-activated theme functions.php file. It would look like this \/yourdomain.com\/wp-content\/themes\/your-activated-theme\/functions.php<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2026\/01\/FTP-functions-1.webp?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-5644 aligncenter\" src=\"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2026\/01\/FTP-functions-1.webp?resize=681%2C465&#038;ssl=1\" alt=\"download functions.php file\" width=\"681\" height=\"465\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong>\u00a0 Now open your functions.php file using any editor you are familiar with, such as simple Notepad or Notepad++. Now, what you have to do is copy the code and paste it into your file at the bottom. This code helps you to create a WordPress Admin User.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">function add_admin_account(){\n    $user = &#039;your username&#039;;\n    $pass = &#039;your password&#039;;\n    $email = &#039;your email address&#039;;\n        if ( !username_exists( $user )  &amp;amp;amp;&amp;amp;amp; !email_exists( $email ) ) {\n            $user_id = wp_create_user( $user, $pass, $email );\n            $user = new WP_User( $user_id );\n            $user-&amp;amp;gt;set_role( &#039;administrator&#039; );\n        } \n}\nadd_action(&#039;init&#039;,&#039;add_admin_account&#039;);\n<\/pre>\n<blockquote><p><strong>Note #1:<\/strong> This is just a code, so please make sure to replace your Username, Password, and Email with your own.<\/p><\/blockquote>\n<p><strong>Step 4.<\/strong>\u00a0 Once you added the code, please upload it back to your website theme folder using FTP.<\/p>\n<p><strong>Step 5.<\/strong>\u00a0 Once uploaded, visit your website login page \/wp-admin or \/wp-login.php or any custom login page you have and sign in with the user account you have created.<\/p>\n<blockquote><p><strong>Note #2:<\/strong>\u00a0 Once you logged in, edit the functions.php file and remove the code you have added.\u00a0 Deleting the code will not make any effect on your account.<\/p><\/blockquote>\n<p>Hope this article helped you learn how to create WordPress admin users through FTP. Please share your thoughts in the comment box.<\/p>\n<p>If you liked this article, please subscribe to our <a href=\"https:\/\/www.youtube.com\/channel\/UCHrhNC-kDVi2m5Pcf4VtCxw\" target=\"_blank\" rel=\"noopener\">YouTube Channel<\/a> for more tutorials. Keep learning and sharing.<\/p>\n<p><a href=\"https:\/\/www.hostg.xyz\/aff_c?offer_id=6&amp;aff_id=115521&amp;url_id=35&amp;file_id=1399\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/media.go2speed.org\/brand\/files\/hostinger\/6\/EN-970x250.jpg?resize=970%2C250&#038;ssl=1\" width=\"970\" height=\"250\" border=\"0\" alt=\"\"><\/a><img decoding=\"async\" style=\"position: absolute; visibility: hidden;\" src=\"https:\/\/www.hostg.xyz\/aff_i?offer_id=6&amp;file_id=1399&amp;aff_id=115521&amp;url_id=35\" width=\"0\" height=\"0\" border=\"0\" alt=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello friends, Today in this article, we will learn how to create WordPress admin users through FTP. FTP will help us to create a WordPress Admin User when we don&#8217;t have any other access. You can explore our FTP tutorial if FTP(File Transfer Protocol) is a new thing to you. A few days back, one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11945,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,5,93],"tags":[503,228,499,94,497,63,498,501,502,500],"class_list":["post-5639","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-php","category-tutorial","tag-add-admin-in-wordpress","tag-create-admin","tag-create-wordpress-admin-via-ftp","tag-ftp","tag-ftp-tutorial","tag-wordpress","tag-wordpress-admin-user","tag-wordpress-security","tag-wordpress-troubleshooting","tag-wordpress-user-management"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2026\/01\/Create-WordPress-Admin-User-Through-FTP.webp?fit=840%2C473&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8zepR-1sX","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4650,"url":"https:\/\/phpyouth.com\/blog\/how-to-resolve-this-page-isnt-working-http-error-500\/","url_meta":{"origin":5639,"position":0},"title":"How to resolve &#8220;This Page isn&#8217;t Working &#8211; HTTP ERROR 500&#8221;","author":"RK Jajoria","date":"April 13, 2018","format":false,"excerpt":"Hello, friends, today we will learn how to resolve \"This Page isn't Working HTTP ERROR 500\". Last week, we got this error while shifting one of my websites from one server to another. However, there's no need to worry, WordPress has this common error, and we can easily resolve it.\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/phpyouth.com\/blog\/category\/tutorial\/php\/"},"img":{"alt_text":"HTTP ERROR 500","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":8880,"url":"https:\/\/phpyouth.com\/blog\/top-10-best-woocommerce-migration-plugins-2025\/","url_meta":{"origin":5639,"position":1},"title":"Top 10 Best WooCommerce Migration Plugins 2025","author":"RK Jajoria","date":"May 14, 2025","format":false,"excerpt":"WooCommerce Migration Plugins can make transferring your online store much easier and more secure. thinking about moving your e-commerce store to a new platform? Naturally, transferring all your data, like products, categories, customers, orders, and subscriptions, can feel pretty intimidating. However, if you\u2019re using WooCommerce, you\u2019re in luck. The process\u2026","rel":"","context":"In &quot;Plugins&quot;","block_context":{"text":"Plugins","link":"https:\/\/phpyouth.com\/blog\/category\/wordpress\/plugins\/"},"img":{"alt_text":"Top 10 Best WooCommerce Migration Plugins 2025","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2025\/05\/Top-10-Best-WooCommerce-Migration-Plugins-2025.webp?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2025\/05\/Top-10-Best-WooCommerce-Migration-Plugins-2025.webp?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2025\/05\/Top-10-Best-WooCommerce-Migration-Plugins-2025.webp?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2025\/05\/Top-10-Best-WooCommerce-Migration-Plugins-2025.webp?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2025\/05\/Top-10-Best-WooCommerce-Migration-Plugins-2025.webp?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":7286,"url":"https:\/\/phpyouth.com\/blog\/top-15-woocommerce-plugins-for-your-store-in-2025\/","url_meta":{"origin":5639,"position":2},"title":"Top 15 WooCommerce Plugins for Your Store in 2025","author":"RK Jajoria","date":"December 20, 2024","format":false,"excerpt":"WordPress stands out as one of the most effective platforms for building and managing eCommerce sites, thanks to its remarkable flexibility and vast selection of WooCommerce plugins. These plugins are essential tools to optimize your store\u2019s performance, enhance the customer experience, and boost sales. Choosing the Top 15 WooCommerce plugins\u2026","rel":"","context":"In &quot;Plugins&quot;","block_context":{"text":"Plugins","link":"https:\/\/phpyouth.com\/blog\/category\/wordpress\/plugins\/"},"img":{"alt_text":"Top 15 Best WooCommerce Plugins in 2025","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2024\/12\/15-Best-WooCommerce-Plugins.webp?fit=729%2C410&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2024\/12\/15-Best-WooCommerce-Plugins.webp?fit=729%2C410&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2024\/12\/15-Best-WooCommerce-Plugins.webp?fit=729%2C410&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2024\/12\/15-Best-WooCommerce-Plugins.webp?fit=729%2C410&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4462,"url":"https:\/\/phpyouth.com\/blog\/add-administrator-user-in-wordpress-using-mysql\/","url_meta":{"origin":5639,"position":3},"title":"Add Administrator User in WordPress Using MySQL","author":"RK Jajoria","date":"September 8, 2017","format":false,"excerpt":"Friends, In today\u2019s article, we\u2019ll learn how to add an administrator user to WordPress using MySQL. Yesterday, my best friend reached out to me because his WordPress site was hacked, and his admin account was deleted. He asked me how he could add a new administrator without accessing the WordPress\u2026","rel":"","context":"In &quot;MySQL&quot;","block_context":{"text":"MySQL","link":"https:\/\/phpyouth.com\/blog\/category\/web-hosting\/database\/mysql\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2017\/09\/2.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2017\/09\/2.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2017\/09\/2.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":5041,"url":"https:\/\/phpyouth.com\/blog\/remove-woocommerce-billing-fields\/","url_meta":{"origin":5639,"position":4},"title":"How to Remove WooCommerce Billing Fields","author":"RK Jajoria","date":"August 8, 2019","format":false,"excerpt":"Hello friends, Good Morning! Today, we are going to learn a WooCommerce trick. This trick is about how to remove WooCommerce billing fields. I want to tell you that WooCommerce is a very powerful WordPress tool that converts a simple website into an E-commerce one. Nowadays, if we look at\u2026","rel":"","context":"In &quot;WooCommerce&quot;","block_context":{"text":"WooCommerce","link":"https:\/\/phpyouth.com\/blog\/category\/wordpress\/plugins\/woocommerce\/"},"img":{"alt_text":"Remove WooCommerce billing fields","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/08\/Remove-WooCommerce-billing-fields.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/08\/Remove-WooCommerce-billing-fields.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/08\/Remove-WooCommerce-billing-fields.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":4973,"url":"https:\/\/phpyouth.com\/blog\/enable-gzip-compression\/","url_meta":{"origin":5639,"position":5},"title":"How to enable GZIP compression","author":"RK Jajoria","date":"July 2, 2019","format":false,"excerpt":"Hello, friends, today\u2019s topic is how to enable GZIP compression on your web server. If you know what GZIP is and how to enable it, that\u2019s good. But if you don\u2019t, please read this tutorial till the end. What is GZIP Compression? GZIP is a file format and software application\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/phpyouth.com\/blog\/category\/web-hosting\/cpanel\/"},"img":{"alt_text":"GZIP-Compression","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts\/5639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/comments?post=5639"}],"version-history":[{"count":0,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts\/5639\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/media\/11945"}],"wp:attachment":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/media?parent=5639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/categories?post=5639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/tags?post=5639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}