www.vietiso.com

Đăng nhập - Tạo tài khoản mới! - Bạn quên mật khẩu? - Ticket system

Hỗ trợ khách hàng 24/7
(+844) 66637879

Gửi yêu cầu qua TICKET?

Tư vấn thiết kế website » Tự động loại bỏ liên kết link nofollow trong bài viết và Comment Wordpress - Bình luận (0)

Tự động loại bỏ liên kết link nofollow trong bài viết và Comment Wordpress

Ở mã nguồn Wordpress mặc định các link liên kết trong bài viết là nofollow, nếu bạn muốn liên kết của bạn sẽ được dofollow, bạn chỉ cần làm như sau:

1. Cách hủy bỏ thuộc tính nofollow từ nội dung bài viết :

Bạn Copy đoạn mã sau, và Paste nó vào file functions.php trong thư mục themes của bạn đang sử dụng:
function remove_nofollow($string) {
$string = str_ireplace(' rel="nofollow"', '', $string);
return $string;
}
add_filter('the_content', 'remove_nofollow');

2. Cách hủy bỏ thuộc tính nofollow từ nội dung bài viết và phần Comment text:

Tương tự như trên, bạn chỉ cần thêm đoạn code sau là được :
function remove_nofollow($string) {
$string = str_ireplace(' rel="nofollow"', '', $string);
return $string;
}
add_filter('the_content', 'remove_nofollow');
add_filter('comment_text', 'remove_nofollow');

 

Payment
Payment Payment