
{"id":5601,"date":"2016-09-04T13:17:24","date_gmt":"2016-09-04T13:17:24","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=5601"},"modified":"2025-04-15T12:16:47","modified_gmt":"2025-04-15T05:16:47","slug":"wordpress-tao-user-admin-trong-wordpress-bang-ftp","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/wordpress-tao-user-admin-trong-wordpress-bang-ftp\/","title":{"rendered":"[WordPress] T\u1ea1o user admin trong wordpress b\u1eb1ng ftp"},"content":{"rendered":"\n<p>Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang t\u00f4i s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng FTP \u0111\u1ec3 th\u00eam m\u1ed9t t\u00e0i kho\u1ea3n admin trong WordPress.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0110\u00f4i l\u00fac b\u1ea1n c\u00f3 th\u1ec3 qu\u00ean user v\u00e0 password c\u1ee7a admin. Trong tr\u01b0\u1eddng h\u1ee3p \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o m\u1ed9t t\u00e0i kho\u1ea3n admin b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng FTP. Nh\u01b0 v\u1eady b\u1ea1n c\u00f3 th\u1ec3 nhanh ch\u00f3ng kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c quy\u1ec1n truy c\u1eadp v\u00e0o khu v\u1ef1c admin WordPress.<\/p>\n\n\n\n<p>Sau khi k\u1ebft n\u1ed1i v\u00e0o trang web WordPress c\u1ee7a b\u1ea1n, b\u1ea1n m\u1edf file <strong>functions.php<\/strong> c\u1ee7a themes b\u1ea1n \u0111ang s\u1eed d\u1ee5ng:<\/p>\n\n\n\n<p>Ch\u00e8n \u0111o\u1ea1n code sau v\u00e0o cu\u1ed1i file <strong>functions.php<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction wpb_admin_account(){\n   $user = 'Username';\n   $pass = 'Password';\n   $email = 'email@domain.com';\n   if ( !username_exists( $user )  &amp;&amp; !email_exists( $email ) ) {\n      $user_id = wp_create_user( $user, $pass, $email );\n      $user = new WP_User( $user_id );\n      $user-&gt;set_role( 'administrator' );\n   }\n}\nadd_action('init','wpb_admin_account');\n<\/pre><\/div>\n\n\n<p>\u0110\u1eebng qu\u00ean thay th\u1ebf <strong>Username<\/strong>, <strong>Password<\/strong>, v\u00e0 <strong>email@domain.com<\/strong> v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<p>Ti\u1ebfp theo, l\u01b0u v\u00e0 upload n\u00f3 l\u00ean trang web c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<p>B\u00e2y gi\u1edd b\u1ea1n c\u00f3 th\u1ec3 gh\u00e9 th\u0103m trang \u0111\u0103ng nh\u1eadp trang web WordPress v\u00e0 \u0111\u0103ng nh\u1eadp v\u1edbi t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng m\u00e0 b\u1ea1n v\u1eeba th\u00eam.<\/p>\n\n\n\n<p>Khi b\u1ea1n \u0111\u00e3 \u0111\u0103ng nh\u1eadp v\u00e0o trang web WordPress c\u1ee7a b\u1ea1n, b\u1ea1n ph\u1ea3i x\u00f3a \u0111o\u1ea1n code m\u1edbi ch\u00e8n v\u00e0o file <strong>functions.php<\/strong>.<\/p>\n\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang t\u00f4i s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng FTP \u0111\u1ec3 th\u00eam m\u1ed9t t\u00e0i kho\u1ea3n admin [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":6979,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-5601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thu-thuat-wordpress"],"views":537,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=5601"}],"version-history":[{"count":1,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5601\/revisions"}],"predecessor-version":[{"id":9717,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5601\/revisions\/9717"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media\/6979"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=5601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=5601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=5601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}