{"id":1987,"date":"2025-02-21T14:48:17","date_gmt":"2025-02-21T05:48:17","guid":{"rendered":"https:\/\/cooss.net\/khi-khong-cap-nhat-duoc-plugin-sau-khi-thay-doi-mien\/"},"modified":"2025-03-16T19:43:25","modified_gmt":"2025-03-16T10:43:25","slug":"khi-khong-cap-nhat-duoc-plugin-sau-khi-thay-doi-mien","status":"publish","type":"post","link":"https:\/\/cooss.net\/vi\/khi-khong-cap-nhat-duoc-plugin-sau-khi-thay-doi-mien\/","title":{"rendered":"Khi kh\u00f4ng c\u1eadp nh\u1eadt \u0111\u01b0\u1ee3c plugin sau khi thay \u0111\u1ed5i mi\u1ec1n"},"content":{"rendered":"\n<p>Thay \u0111\u1ed5i t\u00ean mi\u1ec1n t\u1eeb blog.cooss.net sang cooss.net, t\u00f4i \u0111\u00e3 g\u1eb7p ph\u1ea3i l\u1ed7i nh\u01b0 d\u01b0\u1edbi \u0111\u00e2y khi c\u1eadp nh\u1eadt plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Operation not permitted in ...  \/wp-admin\/includes\/class-wp-filesystem-direct.php on line 173<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Vi\u1ec7c thay \u0111\u1ed5i t\u00ean mi\u1ec1n \u0111\u00e3 \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n theo th\u1ee9 t\u1ef1 d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n\n\n\n<p>C\u1ea7n \u0111\u1ea3m b\u1ea3o r\u1eb1ng t\u00ean mi\u1ec1n m\u1edbi \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i \u0111\u00fang v\u1edbi th\u01b0 m\u1ee5c m\u00e0 WordPress \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. N\u1ebfu kh\u00f4ng, b\u1ea1n c\u00f3 th\u1ec3 g\u1eb7p kh\u00f3 kh\u0103n trong vi\u1ec7c truy c\u1eadp v\u00e0o trang qu\u1ea3n tr\u1ecb WordPress.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Thay \u0111\u1ed5i t\u00ean mi\u1ec1n<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>\u0110\u1ec3 thay \u0111\u1ed5i t\u00ean mi\u1ec1n c\u1ee7a trang WordPress, b\u1ea1n c\u1ea7n th\u1ef1c hi\u1ec7n m\u1ed9t s\u1ed1 b\u01b0\u1edbc. Khi thay \u0111\u1ed5i t\u00ean mi\u1ec1n, c\u1ea7n ph\u1ea3i s\u1eeda \u0111\u1ed5i ch\u00ednh x\u00e1c c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 c\u00e0i \u0111\u1eb7t WordPress \u0111\u1ec3 trang ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng, vui l\u00f2ng tham kh\u1ea3o c\u00e1c ph\u01b0\u01a1ng ph\u00e1p d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Sao l\u01b0u c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/h3>\n\n\n\n<p>Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u thay \u0111\u1ed5i t\u00ean mi\u1ec1n, n\u00ean sao l\u01b0u c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 c\u00e1c t\u1ec7p. C\u01a1 s\u1edf d\u1eef li\u1ec7u WordPress ch\u1ee9a d\u1eef li\u1ec7u quan tr\u1ecdng, v\u00ec v\u1eady h\u00e3y t\u1ea1o m\u1ed9t b\u1ea3n sao l\u01b0u \u0111\u1ec3 c\u00f3 th\u1ec3 ph\u1ee5c h\u1ed3i n\u1ebfu c\u00f3 v\u1ea5n \u0111\u1ec1 x\u1ea3y ra.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Ch\u1ec9nh s\u1eeda t\u1ec7p <code>wp-config.php<\/code><\/h3>\n\n\n\n<p>M\u1edf t\u1ec7p <code>wp-config.php<\/code> v\u00e0 th\u00eam ho\u1eb7c ch\u1ec9nh s\u1eeda hai d\u00f2ng d\u01b0\u1edbi \u0111\u00e2y \u0111\u1ec3 ch\u1ec9 \u0111\u1ecbnh t\u00ean mi\u1ec1n m\u1edbi.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>define('WP_HOME', 'https:\/\/newdomain.com');<br>define('WP_SITEURL', 'https:\/\/newdomain.com');<br><\/code><\/pre>\n\n\n\n<p>\u0110i\u1ec1u n\u00e0y s\u1ebd thi\u1ebft l\u1eadp WordPress \u0111\u1ec3 truy c\u1eadp v\u00e0o t\u00ean mi\u1ec1n m\u1edbi m\u1eb7c \u0111\u1ecbnh. <br>(Thay th\u1ebf ph\u1ea7n <code>newdomain.com<\/code> b\u1eb1ng \u0111\u1ecba ch\u1ec9 t\u00ean mi\u1ec1n m\u1edbi.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Thay \u0111\u1ed5i URL trong c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/h3>\n\n\n\n<p>WordPress l\u01b0u tr\u1eef URL t\u00ean mi\u1ec1n trong c\u01a1 s\u1edf d\u1eef li\u1ec7u, v\u00ec v\u1eady b\u1ea1n c\u1ea7n thay \u0111\u1ed5i URL c\u0169 th\u00e0nh t\u00ean mi\u1ec1n m\u1edbi.<\/p>\n\n\n\n<p>S\u1eed d\u1ee5ng truy v\u1ea5n SQL sau \u0111\u1ec3 s\u1eeda \u0111\u1ed5i URL trong b\u1ea3ng <code>wp_options<\/code>. <code>wp_<\/code> l\u00e0 ti\u1ec1n t\u1ed1 b\u1ea3ng m\u1eb7c \u0111\u1ecbnh, n\u1ebfu kh\u00f4ng \u0111\u00fang th\u00ec h\u00e3y ki\u1ec3m tra v\u00e0 s\u1eeda \u0111\u1ed5i ti\u1ec1n t\u1ed1 b\u1ea3ng.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sql\ubcf5\uc0ac\ud3b8\uc9d1<code>UPDATE wp_options SET option_value = replace(option_value, 'https:\/\/olddomain.com', 'https:\/\/newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';\n<\/code><\/pre>\n\n\n\n<p>C\u00e1c b\u1ea3ng kh\u00e1c nh\u01b0 <code>wp_posts<\/code> v\u00e0 <code>wp_postmeta<\/code> c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng URL, v\u00ec v\u1eady n\u00ean thay \u0111\u1ed5i URL trong t\u1ea5t c\u1ea3 c\u00e1c b\u1ea3ng.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">V\u00ed d\u1ee5 truy v\u1ea5n:<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">sql\ubcf5\uc0ac\ud3b8\uc9d1<code>UPDATE wp_posts SET guid = replace(guid, 'https:\/\/olddomain.com','https:\/\/newdomain.com');\nUPDATE wp_posts SET post_content = replace(post_content, 'https:\/\/olddomain.com', 'https:\/\/newdomain.com');\nUPDATE wp_postmeta SET meta_value = replace(meta_value,'https:\/\/olddomain.com','https:\/\/newdomain.com');\n<\/code><\/pre>\n\n\n\n<p>C\u00f4ng vi\u1ec7c n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n qua c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u (v\u00ed d\u1ee5: phpMyAdmin) ho\u1eb7c qua CLI c\u1ee7a WordPress.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. S\u1eed d\u1ee5ng plugin t\u00ecm ki\u1ebfm v\u00e0 thay th\u1ebf (t\u00f9y ch\u1ecdn)<\/h3>\n\n\n\n<p>C\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng plugin nh\u01b0 <a>Better Search Replace<\/a> \u0111\u1ec3 thay \u0111\u1ed5i URL trong c\u01a1 s\u1edf d\u1eef li\u1ec7u. Plugin n\u00e0y cho ph\u00e9p b\u1ea1n t\u00ecm v\u00e0 thay th\u1ebf m\u1ed9t URL c\u1ee5 th\u1ec3 trong t\u1ea5t c\u1ea3 c\u00e1c b\u1ea3ng.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. C\u1eadp nh\u1eadt b\u1ed9 nh\u1edb cache v\u00e0 c\u00e0i \u0111\u1eb7t permalink<\/h3>\n\n\n\n<p>Sau khi thay \u0111\u1ed5i, n\u00ean x\u00f3a b\u1ed9 nh\u1edb cache c\u1ee7a trang v\u00e0 v\u00e0o menu <strong>C\u00e0i \u0111\u1eb7t &gt; Permalink<\/strong> trong m\u00e0n h\u00ecnh qu\u1ea3n tr\u1ecb WordPress \u0111\u1ec3 l\u01b0u l\u1ea1i c\u00e0i \u0111\u1eb7t permalink. \u0110i\u1ec1u n\u00e0y gi\u00fap ph\u1ea3n \u00e1nh c\u1ea5u tr\u00fac URL m\u1edbi v\u00e0 ng\u0103n ng\u1eeba l\u1ed7i li\u00ean k\u1ebft.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Th\u00f4ng b\u00e1o thay \u0111\u1ed5i t\u00ean mi\u1ec1n cho Google v\u00e0 d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i<\/h3>\n\n\n\n<p>Khi t\u00ean mi\u1ec1n c\u1ee7a trang \u0111\u01b0\u1ee3c thay \u0111\u1ed5i, c\u1ea7n \u0111\u0103ng k\u00fd v\u00e0 th\u00f4ng b\u00e1o t\u00ean mi\u1ec1n m\u1edbi cho c\u00e1c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i nh\u01b0 Google Search Console, Google Analytics. \u0110i\u1ec1u n\u00e0y gi\u00fap gi\u1ea3m thi\u1ec3u t\u00e1c \u0111\u1ed9ng \u0111\u1ebfn SEO.<\/p>\n\n\n\n<p>N\u1ebfu th\u1ef1c hi\u1ec7n c\u00e1c b\u01b0\u1edbc tr\u00ean, vi\u1ec7c thay \u0111\u1ed5i t\u00ean mi\u1ec1n c\u1ee7a trang WordPress s\u1ebd ho\u00e0n t\u1ea5t.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Vi\u1ec7c thay \u0111\u1ed5i t\u00ean mi\u1ec1n \u0111\u00e3 th\u00e0nh c\u00f4ng, v\u00e0 ch\u1ec9 c\u1ea7n th\u1ef1c hi\u1ec7n \u0111\u1ebfn b\u01b0\u1edbc 2) th\u00ec trang \u0111\u00e3 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi t\u00ean mi\u1ec1n m\u1edbi. Tuy nhi\u00ean, \u0111\u1ecba ch\u1ec9 c\u1ee7a c\u00e1c t\u1ec7p h\u00ecnh \u1ea3nh \u0111\u00e3 t\u1ea3i l\u00ean v\u1eabn \u0111\u01b0\u1ee3c l\u01b0u v\u1edbi \u0111\u1ecba ch\u1ec9 t\u00ean mi\u1ec1n c\u0169, v\u00ec v\u1eady n\u1ebfu kh\u00f4ng s\u1eed d\u1ee5ng t\u00ean mi\u1ec1n c\u0169 ho\u1eb7c k\u1ebft n\u1ed1i v\u1edbi m\u00e1y ch\u1ee7 kh\u00e1c, c\u00e1c h\u00ecnh \u1ea3nh s\u1ebd kh\u00f4ng hi\u1ec3n th\u1ecb. Do \u0111\u00f3, n\u00ean th\u1ef1c hi\u1ec7n c\u00e1c c\u00f4ng vi\u1ec7c c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f2n l\u1ea1i. Sau khi th\u1ef1c hi\u1ec7n t\u1ea5t c\u1ea3 c\u00e1c c\u00f4ng vi\u1ec7c c\u01a1 s\u1edf d\u1eef li\u1ec7u, thay \u0111\u1ed5i \u1edf b\u01b0\u1edbc 2) s\u1ebd kh\u00f4ng c\u00f2n c\u1ea7n thi\u1ebft n\u1eefa n\u00ean c\u00f3 th\u1ec3 x\u00f3a \u0111i. (C\u0169ng c\u00f3 th\u1ec3 \u0111\u1ec3 nguy\u00ean kh\u00f4ng sao c\u1ea3)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gi\u1ea3i quy\u1ebft v\u1ea5n \u0111\u1ec1 c\u1eadp nh\u1eadt plugin<\/h2>\n\n\n\n<p>B\u00e2y gi\u1edd t\u00f4i \u0111\u00e3 t\u00ecm ra l\u00fd do t\u1ea1i sao vi\u1ec7c c\u1eadp nh\u1eadt plugin kh\u00f4ng ho\u1ea1t \u0111\u1ed9ng t\u1ed1t.<\/p>\n\n\n\n<p>C\u00f3 th\u1ec3 c\u00f3 nhi\u1ec1u nguy\u00ean nh\u00e2n kh\u00e1c nhau, nh\u01b0ng trong tr\u01b0\u1eddng h\u1ee3p c\u1ee7a t\u00f4i, c\u00f3 v\u1ebb nh\u01b0 d\u1eef li\u1ec7u t\u1ea1m th\u1eddi \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef l\u00e0 v\u1ea5n \u0111\u1ec1.<\/p>\n\n\n\n<p>T\u00f4i \u0111\u00e3 th\u1ef1c hi\u1ec7n truy v\u1ea5n \u0111\u1ec3 x\u00f3a d\u1eef li\u1ec7u t\u1ea1m th\u1eddi trong mysql nh\u01b0 d\u01b0\u1edbi \u0111\u00e2y v\u00e0 vi\u1ec7c c\u1eadp nh\u1eadt plugin \u0111\u00e3 \u0111\u01b0\u1ee3c gi\u1ea3i quy\u1ebft.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DELETE FROM wp_options WHERE option_name LIKE '_transient_%';\nDELETE FROM wp_options WHERE option_name LIKE '_site_transient_%';\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Thay \u0111\u1ed5i t\u00ean mi\u1ec1n t\u1eeb blog.cooss.net sang cooss.net, t\u00f4i \u0111\u00e3 g\u1eb7p ph\u1ea3i l\u1ed7i nh\u01b0 d\u01b0\u1edbi \u0111\u00e2y khi c\u1eadp nh\u1eadt plugin. Vi\u1ec7c thay \u0111\u1ed5i t\u00ean mi\u1ec1n \u0111\u00e3 \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n theo th\u1ee9 t\u1ef1 d\u01b0\u1edbi \u0111\u00e2y. C\u1ea7n \u0111\u1ea3m b\u1ea3o r\u1eb1ng t\u00ean mi\u1ec1n m\u1edbi \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i \u0111\u00fang v\u1edbi th\u01b0 m\u1ee5c m\u00e0 WordPress \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. N\u1ebfu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1987","post","type-post","status-publish","format-standard","hentry","category-wordpress-vi"],"_links":{"self":[{"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/posts\/1987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/comments?post=1987"}],"version-history":[{"count":0,"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/posts\/1987\/revisions"}],"wp:attachment":[{"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/media?parent=1987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/categories?post=1987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cooss.net\/vi\/wp-json\/wp\/v2\/tags?post=1987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}