Hướng dẫn đổi tên wp-content trong WordPress [Tips to rename wp-content folder in WordPress]

in haynhat •  5 years ago 


Không phức tạp như đổi tên wp-admin và đổi tên wp-includes trong Wordpress, đổi tên wp-content trong Wordpress khá đơn giản. Chỉ cần cấu hình trong file wp-config.php trong thư mục root của website Wordpress là xong. Bài viết sau sẽ hướng dẫn chi tiết cách đổi tên wp-content trong Wordpress.

Hướng dẫn đổi tên wp-content trong WordPress
Hướng dẫn đổi tên wp-content trong WordPress

Thư mục wp-content chứa toàn bộ các theme, pluggin, upgrade và các file upload lên (mặc định) của website Wordpress. Với 2 bước đơn giản sau, chúng ta sẽ đổi tên hoàn toàn wp-content trong Wordpress

Hướng dẫn cấu hình đổi tên wp-content trong Wordpress


Bước 1: Thiết lập lại cấu hình đường dẫn đến thư mục wp-content trong file wp-config.php

  • Truy cập vào host của website qua giao thức FTP, ở đây mình dùng phần mềm FileZilla (hoàn toàn miễn phí)
  • Thêm đoạn mã bên dưới vào cuối của file (hoặc bất kỳ vị trí nào sau dòng <?php )
define ('WP_CONTENT_FOLDERNAME', 'media'); define ('WP_CONTENT_DIR',ABSPATH.WP_CONTENT_FOLDERNAME); define('WP_SITEURL','http://'.$_SERVER['HTTP_HOST']. '/'); define('WP_CONTENT_URL',WP_SITEURL . WP_CONTENT_FOLDERNAME);

define('WP_PLUGIN_DIR',WP_CONTENT_DIR.'/plugins');
define('WP_PLUGIN_URL',WP_CONTENT_URL.'/plugins');
define('UPLOADS',WP_CONTENT_FOLDERNAME.'/files' );

- Lưu lại và up lên host.
Tips to rename wp-content folder in WordPress

Bước 2: Đổi tên các file, folder liên quan đến wp-admin thành tên bất kỳ mà bạn muốn (tương ứng với xâu mà bạn đã thay đổi ở bước 1)
Đổi tên thư mục wp-content thành tên mà bạn vừa thiết lập trong file wp-config.php mà bạn vừa cấu hình ở bước 1 (ở ví dụ trên là media). Lưu lại.


DONE !
Các bạn đã đổi tên wp-content thành công cho website Wordpress của mình. Bây giờ các bạn sẽ thấy đường dẫn đến các file ảnh trong website của bạn có dạng
Chúc vui !
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://wikitipz.com/webmaster/tips-rename-wp-content-folder-wordpress-huong-dan-doi-ten-wp-content-trong-wordpress/

Congratulations @wikitips! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You published more than 30 posts. Your next target is to reach 40 posts.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!