{"id":4331,"date":"2020-02-28T14:47:04","date_gmt":"2020-02-28T07:47:04","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=4331"},"modified":"2020-03-30T08:55:57","modified_gmt":"2020-03-30T01:55:57","slug":"xu-ly-loi-trang-trang-tren-wordpress","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/xu-ly-loi-trang-trang-tren-wordpress\/","title":{"rendered":"X\u1eed l\u00fd l\u1ed7i tr\u1eafng trang tr\u00ean WordPress"},"content":{"rendered":"<p>L\u1ed7i tr\u1eafng trang trong wordpress kh\u00f4ng ph\u1ea3i l\u00fac n\u00e0o c\u0169ng xu\u1ea5t hi\u1ec7n tr\u00ean to\u00e0n trang, \u0111\u00f4i l\u00fac l\u1ed7i ch\u1ec9 xu\u1ea5t hi\u1ec7n \u1edf m\u1ed9t page n\u00e0o \u0111\u00f3 nh\u01b0 trang admin, m\u1ed9t post n\u00e0o \u0111\u00f3 c\u00f2n l\u1ea1i m\u1ecdi th\u1ee9 v\u1eabn ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng v\u00e0 kh\u00f4ng c\u00f3 m\u1ed9t th\u00f4ng b\u00e1o n\u00e0o kh\u00e1c, v\u00ec v\u1eady h\u00f4m nay ch\u00fang ta th\u1eed t\u00ecm hi\u1ec3u v\u1ec1 l\u1ed7i n\u00e0y nh\u00e9..<\/p>\n<h2 id=\"Kh\u1eafc_ph\u1ee5c_l\u1ed7i_tr\u1eafng_trang_trong_WordPress\">Kh\u1eafc ph\u1ee5c l\u1ed7i tr\u1eafng trang trong WordPress<span id=\"khac-phuc-loi-trang-trang-trong-wordpress\" class=\"ez-toc-section\"><\/span><\/h2>\n<h3 id=\"1.\u00a0Ph\u00e1t_hi\u1ec7n_nguy\u00ean_nh\u00e2n_g\u00e2y_l\u1ed7i_v\u1edbi_WP_DEBUG\">1.\u00a0Ph\u00e1t hi\u1ec7n nguy\u00ean nh\u00e2n g\u00e2y l\u1ed7i v\u1edbi WP_DEBUG<span id=\"1-phat-hien-nguyen-nhan-gay-loi-voi-wp-debug\" class=\"ez-toc-section\"><\/span><\/h3>\n<p>B\u1ea1n b\u1eadt ch\u1ebft \u0111\u1ed9 debug tr\u00ean wordpress b\u1eb1ng c\u00e1ch h\u00e3y th\u00eam d\u00f2ng code sau \u0111\u00e2y v\u00e0o file <em>wp-config.php<\/em>:<\/p>\n<div id=\"gist21372479\" class=\"gist\">\n<div class=\"gist-file\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container file-box\">\n<div id=\"file-wp-config-php\" class=\"file\">\n<pre class=\"Box-body p-0 blob-wrapper data type-php \">define( 'WP_DEBUG', true );<\/pre>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>L\u01b0u \u00fd, b\u1ea1n ph\u1ea3i ch\u00e8n n\u00f3 v\u00e0o b\u00ean tr\u00ean d\u00f2ng sau:<\/p>\n<div id=\"gist21372592\" class=\"gist\">\n<div class=\"gist-file\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container file-box\">\n<div id=\"file-wp-config-php-stop-editing\" class=\"file\">\n<pre class=\"Box-body p-0 blob-wrapper data type-text \">\/* That's all, stop editing! Happy blogging. *\/<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"gist-meta\"><\/div>\n<p>N\u1ebfu file\u00a0<em>wp-config.php<\/em>\u00a0c\u1ee7a b\u1ea1n \u0111\u00e3 c\u00f3 s\u1eb5n \u0111o\u1ea1n code WP_DEBUG, b\u1ea1n ch\u1ec9 c\u1ea7n chuy\u1ec3n gi\u00e1 tr\u1ecb c\u1ee7a n\u00f3 t\u1eeb\u00a0<em>false<\/em>\u00a0sang\u00a0<em>true<\/em>\u00a0l\u00e0 \u0111\u01b0\u1ee3c.<\/p>\n<p>Gi\u1edd b\u1ea1n c\u00f3 th\u1ec3 xem th\u00f4ng tin l\u1ed7i khi truy c\u1eadp trang ho\u1eb7c l\u00e0 t\u1ea1i file <strong>error_log\u00a0<\/strong>n\u1eb1m ngang h\u00e0ng v\u1edbi file wp-config.php<\/p>\n<p>M\u1ed9t khi \u0111\u00e3 ph\u00e1t hi\u1ec7n \u0111\u01b0\u1ee3c nguy\u00ean nh\u00e2n g\u00e2y l\u1ed7i, b\u1ea1n c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u t\u00ecm c\u00e1ch s\u1eeda ch\u1eefa n\u00f3 (copy m\u00e3 l\u1ed7i v\u00e0 t\u00ecm ki\u1ebfm h\u01b0\u1edbng d\u1eabn tr\u00ean <em>Google<\/em>\u00a0ch\u1eb3ng h\u1ea1n).<\/p>\n<h3 id=\"2._Ph\u00e1t_hi\u1ec7n_nguy\u00ean_nh\u00e2n_g\u00e2y_l\u1ed7i_b\u1eb1ng_plugin\">2. Ph\u00e1t hi\u1ec7n nguy\u00ean nh\u00e2n g\u00e2y l\u1ed7i b\u1eb1ng plugin<span id=\"2-phat-hien-nguyen-nhan-gay-loi-bang-plugin\" class=\"ez-toc-section\"><\/span><\/h3>\n<p>R\u1ea5t nhi\u1ec1u plugin c\u00f3 s\u1eb5n c\u00f3 th\u1ec3 gi\u00fap b\u1ea1n nhanh ch\u00f3ng\u00a0x\u1eed l\u00fd c\u00e1c s\u1ef1 c\u1ed1 tr\u00ean blog\/ website c\u1ee7a m\u00ecnh m\u1ed9t c\u00e1ch d\u1ec5 d\u00e0ng. N\u1ebfu b\u1ea1n v\u1eabn c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c v\u00e0o b\u1ea3ng \u0111i\u1ec1u khi\u1ec3n\u00a0<em>WordPress<\/em>\u00a0(ch\u1ec9 b\u1ecb tr\u1eafng trang \u1edf giao di\u1ec7n b\u00ean ngo\u00e0i), h\u00e3y\u00a0c\u1ed1 g\u1eafng c\u00e0i \u0111\u1eb7t m\u1ed9t plugin \u0111\u1ec3 gi\u00fap x\u00e1c \u0111\u1ecbnh nguy\u00ean nh\u00e2n g\u00e2y l\u1ed7i.<\/p>\n<ul>\n<li>\u0110\u1ec3 b\u1eadt ch\u1ebf \u0111\u1ed9 debug, h\u00e3y d\u00f9ng th\u1eed\u00a0plugin\u00a0<em>Debug<\/em>. C\u00f2n n\u1ebfu b\u1ea1n mu\u1ed1n c\u00f3 th\u00eam l\u1ef1a ch\u1ecdn \u0111\u1ec3 x\u1eed l\u00fd s\u1ef1 c\u1ed1\u00a0th\u00ec\u00a0<em>Debug Bar<\/em>\u00a0ch\u00ednh l\u00e0 plugin m\u00e0 b\u1ea1n \u0111ang c\u1ea7n.<\/li>\n<li>\u0110\u1ed1i v\u1edbi\u00a0<em>WordPress<\/em>\u00a0multisite, c\u00f3 m\u1ed9t plugin \u0111\u00e3 \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1eb7c bi\u1ec7t d\u00e0nh ri\u00eang cho c\u00e1c networks v\u00e0 super admin, gi\u00fap x\u1eed l\u00fd\u00a0c\u00e1c s\u1ef1 c\u1ed1,\u00a0\u0111\u01b0\u1ee3c g\u1ecdi l\u00e0\u00a0<em>Debug This<\/em>. N\u00f3 s\u1edf h\u1eefu \u0111\u1ea7y \u0111\u1ee7 ch\u1ee9c n\u0103ng\u00a0c\u1ee7a h\u1ea7u h\u1ebft c\u00e1c plugin g\u1ee1 l\u1ed7i kh\u00e1c.<\/li>\n<\/ul>\n<p>3\u00a0Plugins k\u1ec3 tr\u00ean \u0111\u1ec1u \u0111\u00e1ng tin c\u1eady v\u00e0 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt th\u01b0\u1eddng xuy\u00ean \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o kh\u1ea3 n\u0103ng t\u01b0\u01a1ng th\u00edch c\u0169ng nh\u01b0 s\u1ef1 \u1ed5n \u0111\u1ecbnh. M\u1ed9t khi b\u1ea1n \u0111\u00e3 ch\u1ecdn \u0111\u01b0\u1ee3c plugin ph\u00f9 h\u1ee3p, h\u00e3y ti\u1ebfn h\u00e0nh c\u00e0i \u0111\u1eb7t v\u00e0 b\u1eaft \u0111\u1ea7u t\u00ecm ki\u1ebfm c\u00e1c l\u1ed7i c\u1ea7n s\u1eeda ch\u1eefa.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"M\u1ed9t_s\u1ed1_l\u1eddi_khuy\u00ean_h\u1eefu_\u00edch_kh\u00e1c\">M\u1ed9t s\u1ed1 l\u1eddi khuy\u00ean h\u1eefu \u00edch kh\u00e1c<span id=\"mot-so-loi-khuyen-huu-ich-khac\" class=\"ez-toc-section\"><\/span><\/h2>\n<h3 id=\"1._Kh\u00f4i_ph\u1ee5c\u00a0theme\u00a0WordPress_m\u1eb7c_\u0111\u1ecbnh\">1. Kh\u00f4i ph\u1ee5c\u00a0theme\u00a0WordPress m\u1eb7c \u0111\u1ecbnh<span id=\"1-khoi-phuc-theme-wordpress-mac-dinh\" class=\"ez-toc-section\"><\/span><\/h3>\n<p>N\u1ebfu b\u1ea1n v\u1eabn c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c v\u00e0o trang qu\u1ea3n tr\u1ecb c\u1ee7a\u00a0<em>WordPress<\/em>, h\u00e3y th\u1eed \u0111\u1ed5i v\u1ec1 theme m\u1eb7c \u0111\u1ecbnh xem sao. N\u1ebfu l\u1ed7i tr\u1eafng trang bi\u1ebfn m\u1ea5t v\u00e0 blog\/ website c\u1ee7a b\u1ea1n xu\u1ea5t hi\u1ec7n tr\u1edf l\u1ea1i th\u00ec\u00a0c\u00f3 ngh\u0129a l\u00e0 theme\u00a0m\u00e0 b\u1ea1n \u0111ang s\u1eed d\u1ee5ng c\u00f3 l\u1ed7i ho\u1eb7c xung \u0111\u1ed9t\u00a0v\u1edbi\u00a0<em>WordPress<\/em>\u00a0ho\u1eb7c m\u1ed9t trong nh\u1eefng plugin \u0111ang d\u00f9ng.<\/p>\n<p>Trong tr\u01b0\u1eddng h\u1ee3p ng\u01b0\u1ee3c l\u1ea1i, h\u00e3y truy c\u1eadp th\u01b0 m\u1ee5c c\u00e0i \u0111\u1eb7t\u00a0<em>WordPress<\/em>\u00a0th\u00f4ng qua\u00a0<em>cPanel <\/em>\/\u00a0<em>DirectAdmin<\/em>\u00a0ho\u1eb7c ph\u1ea7n m\u1ec1m\u00a0<em>FTP<\/em>, t\u00ecm t\u1edbi \u0111\u1ecba ch\u1ec9\u00a0<em>\/wp-content\/themes\/<\/em>\u00a0v\u00e0 \u0111\u1ed5i t\u00ean th\u01b0 m\u1ee5c c\u1ee7a theme m\u00e0 b\u1ea1n \u0111ang d\u00f9ng. N\u1ebfu nguy\u00ean nh\u00e2n l\u00e0 do theme, b\u1ea1n s\u1ebd c\u00f3 th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c v\u00e0o trang qu\u1ea3n tr\u1ecb c\u1ee7a\u00a0<em>WordPress<\/em>\u00a0\u0111\u1ec3 k\u00edch ho\u1ea1t theme m\u1eb7c \u0111\u1ecbnh.<\/p>\n<h3 id=\"2._V\u00f4_hi\u1ec7u_h\u00f3a_t\u1ea5t_c\u1ea3_c\u00e1c_plugin_\u0111ang_k\u00edch_ho\u1ea1t\">2. V\u00f4 hi\u1ec7u h\u00f3a t\u1ea5t c\u1ea3 c\u00e1c plugin \u0111ang k\u00edch ho\u1ea1t<span id=\"2-vo-hieu-hoa-tat-ca-cac-plugin-dang-kich-hoat\" class=\"ez-toc-section\"><\/span><\/h3>\n<p>Truy c\u1eadp th\u01b0 m\u1ee5c c\u00e0i \u0111\u1eb7t\u00a0<em>WordPress<\/em>\u00a0c\u1ee7a b\u1ea1n th\u00f4ng qua\u00a0<em>cPanel<\/em>\/\u00a0<em>DirectAdmin<\/em>\u00a0ho\u1eb7c ph\u1ea7n m\u1ec1m\u00a0<em>FTP<\/em>, t\u00ecm t\u1edbi \u0111\u1ecba ch\u1ec9\u00a0<em>\/wp-content\/plugins\/<\/em>\u00a0v\u00e0 \u0111\u1ed5i t\u00ean to\u00e0n b\u1ed9 th\u01b0 m\u1ee5c c\u1ee7a c\u00e1c plugin m\u00e0 b\u1ea1n \u0111\u00e3 c\u00e0i \u0111\u1eb7t. N\u1ebfu blog\/ website c\u1ee7a b\u1ea1n ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng tr\u1edf l\u1ea1i, h\u00e3y th\u1eed k\u00edch ho\u1ea1t l\u1ea7n l\u01b0\u1ee3t t\u1eebng plugin m\u1ed9t cho \u0111\u1ebfn khi l\u1ed7i tr\u1eafng trang xu\u1ea5t hi\u1ec7n. Khi \u0111\u00f3, b\u1ea1n s\u1ebd bi\u1ebft plugin n\u00e0o ch\u00ednh l\u00e0 nguy\u00ean nh\u00e2n g\u00e2y ra v\u1ea5n \u0111\u1ec1.<\/p>\n<h3 id=\"3._B\u1ea1n_\u0111ang_s\u1eed_d\u1ee5ng_m\u1ed9t_plugin_t\u1ea1o_b\u1ed9_nh\u1edb_\u0111\u1ec7m_(cache)?\">3. B\u1ea1n \u0111ang s\u1eed d\u1ee5ng m\u1ed9t plugin t\u1ea1o b\u1ed9 nh\u1edb \u0111\u1ec7m (cache)?<span id=\"3-ban-dang-su-dung-mot-plugin-tao-bo-nho-dem-cache\" class=\"ez-toc-section\"><\/span><\/h3>\n<p>Plugin t\u1ea1o b\u1ed9 nh\u1edb \u0111\u1ec7m (cache) c\u00f3 th\u1ec3 l\u00e0 nguy\u00ean nh\u00e2n g\u00e2y ra l\u1ed7i tr\u1eafng trang cho blog\/ website c\u1ee7a b\u1ea1n, \u0111\u1eb7c bi\u1ec7t l\u00e0 khi b\u1ea1n update d\u1eef li\u1ec7u ho\u1eb7c chuy\u1ec3n host m\u00e0 qu\u00ean kh\u00f4ng v\u00f4 hi\u1ec7u h\u00f3a plugi n\u00e0y. \u0110\u1ec3 ki\u1ec3m tra xem plugin t\u1ea1o cache c\u00f3 ph\u1ea3i l\u00e0 th\u1ee7 ph\u1ea1m hay kh\u00f4ng, c\u00e1c b\u1ea1n ch\u1ec9 c\u1ea7n truy c\u1eadp th\u01b0 m\u1ee5c\u00a0<em>\/wp-content\/plugins\/<\/em>, t\u00ecm v\u00e0 \u0111\u1ed5i t\u00ean th\u01b0 m\u1ee5c c\u1ee7a n\u00f3 \u0111i l\u00e0 \u0111\u01b0\u1ee3c.<\/p>\n<h3 id=\"4._T\u0103ng_gi\u1edbi_h\u1ea1n_memmory_limit\">4. T\u0103ng gi\u1edbi h\u1ea1n memmory_limit<\/h3>\n<p>\u0110\u1ed1i v\u1edbi vi\u1ec7c s\u1eed d\u1ee5ng hosting, b\u1ea1n c\u00f3 th\u1ec3 t\u0103ng d\u1ec5 d\u00e0ng th\u00f4i qua Phpselector: https:\/\/tino.vn\/blog\/docs\/huong-dan-thay-doi-thong-so-php-selector\/<\/p>\n<p>\u0110\u1ed1i v\u1edbi vi\u1ec7c s\u1eed d\u1ee5ng VPS b\u1ea1n c\u00f3 th\u1ec3 t\u00ecm t\u1edbi file php.ini v\u00e0 ch\u1ec9nh th\u00f4ng s\u1ed1 memory_limit\u00a0 th\u00e0nh 512M, sau \u0111\u00f3 b\u1ea1n restart l\u1ea1i d\u1ecbch v\u1ee5 httpd.<\/p>\n<p>&nbsp;<\/p>\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>L\u1ed7i tr\u1eafng trang trong wordpress kh\u00f4ng ph\u1ea3i l\u00fac n\u00e0o c\u0169ng xu\u1ea5t hi\u1ec7n tr\u00ean to\u00e0n trang, \u0111\u00f4i l\u00fac l\u1ed7i ch\u1ec9 xu\u1ea5t hi\u1ec7n \u1edf m\u1ed9t page n\u00e0o \u0111\u00f3 nh\u01b0 trang admin, m\u1ed9t post n\u00e0o \u0111\u00f3 c\u00f2n l\u1ea1i m\u1ecdi th\u1ee9 v\u1eabn ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng v\u00e0 kh\u00f4ng c\u00f3 m\u1ed9t th\u00f4ng b\u00e1o n\u00e0o kh\u00e1c, v\u00ec v\u1eady h\u00f4m nay ch\u00fang [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":16424,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[5154],"class_list":["post-4331","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/4331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=4331"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/4331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/16424"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=4331"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=4331"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=4331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}