Xóa bỏ code svg trong thẻ body từ WordPress 5.9 ~ Kiếm Tiền Online

Sunday, February 4, 2024

Xóa bỏ code svg trong thẻ body từ WordPress 5.9

Từ phiên bản WordPress 5.9 1 sẽ có 1 đoạn code SVG nằm trong thẻ body của website của bạn. Mã SVG này liên quan đến sự tương thích đối với trình duyệt Safari với bộ lọc Duotone được thêm bởi WordPress Gutenberg Editor

code svg trong thẻ body

Đây là đoạn code svg được add vào hook wp_body_open nên nếu bạn check không có thẻ svg kia thì chắc chắn theme bạn cũ và không có hook wp_body_open nên Gutenberg Editor không gắn code kia vào được.

wp body open

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-dark-grayscale">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0 0.49803921568627" />        <feFuncG type="table" tableValues="0 0.49803921568627" />        <feFuncB type="table" tableValues="0 0.49803921568627" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-grayscale">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0 1" />        <feFuncG type="table" tableValues="0 1" />        <feFuncB type="table" tableValues="0 1" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-purple-yellow">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0.54901960784314 0.98823529411765" />        <feFuncG type="table" tableValues="0 1" />        <feFuncB type="table" tableValues="0.71764705882353 0.25490196078431" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-blue-red">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0 1" />        <feFuncG type="table" tableValues="0 0.27843137254902" />        <feFuncB type="table" tableValues="0.5921568627451 0.27843137254902" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-midnight">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0 0" />        <feFuncG type="table" tableValues="0 0.64705882352941" />        <feFuncB type="table" tableValues="0 1" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-magenta-yellow">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0.78039215686275 1" />        <feFuncG type="table" tableValues="0 0.94901960784314" />        <feFuncB type="table" tableValues="0.35294117647059 0.47058823529412" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-purple-green">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0.65098039215686 0.40392156862745" />        <feFuncG type="table" tableValues="0 1" />        <feFuncB type="table" tableValues="0.44705882352941 0.4" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;">  <defs>    <filter id="wp-duotone-blue-orange">      <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 " />      <feComponentTransfer color-interpolation-filters="sRGB">        <feFuncR type="table" tableValues="0.098039215686275 1" />        <feFuncG type="table" tableValues="0 0.66274509803922" />        <feFuncB type="table" tableValues="0.84705882352941 0.41960784313725" />        <feFuncA type="table" tableValues="1 1" />      </feComponentTransfer>      <feComposite in2="SourceGraphic" operator="in" />    </filter>  </defs></svg>

Nếu bạn không tiêu dùng Gutenberg Editor bạn có thể xóa chúng nhanh chóng bằng cách đơn giản đó là dán đoạn code này vào file functions.php là xong. (File functions.php nằm trong thư mục chứa theme của bạn)

remove_action ('wp_body_open', 'wp_global_styles_render_svg_filters');

Sau khi thêm vào bạn thử xóa cache và check lại sẽ thấy đoạn code svg kia đã được loại bỏ khỏi website của bạn.

Ngoài ra, có 1 đoạn code nữa bạn cũng nên loại bỏ khỏi website của bạn nếu không tiêu dùng Gutenberg đó là đoạn code

<style id='global-styles-inline-css' type='text/css'>body{--wp--preset--color--black:#000;--wp--preset--color--cyan-bluish-gray:#abb8c3;--wp--preset--color--white:#fff;--wp--preset--color--pale-pink:#f78da7;--wp--preset--color--vivid-red:#cf2e2e;--wp--preset--color--luminous-vivid-orange:#ff6900;--wp--preset--color--luminous-vivid-amber:#fcb900 ..................................</style>

Bạn có thể view-source lên và search với từ khóa <style id='global-styles-inline-css' type='text/css'> để biết rõ về đoạn code này.

Để xóa chúng đi bạn chỉ cần thêm đoạn code sau vào file functions.php

remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');

Nhắc lại thêm 1 lần nữa, nếu bạn không tiêu dùng Gutenberg Editor hãy xóa 2 đoạn trên đi để website của bạn được nhẹ nhàng hơn, điểm tối ưu web cũng sẽ tăng lên đấy.

Chúc bạn thành công!

Related Posts:

  • Cách xóa toàn bộ comment spam / pending WordPressCách xóa toàn bộ comment spam / pending WordPressCách xóa toàn bộ comment spam hoặc pending trong WordPressTôi có cung cấp cho khách hàng của tôi plugin chống spam miễn phí bạn có thể xem thêm thông tin tại đâyNếu website của… Read More
  • Theo dõi email gửi đi trong WordPress – Email LogTheo dõi email gửi đi trong WordPress – Email LogNếu bạn cấu hình SMTP để gửi thư trong website WordPress thì đa số các plugin sẽ thu phí thêm tính năng theo dõi các email được gửi đi nên trong bài viết này tôi giới thiệu cho… Read More
  • Tạo tài khoản Admin WordPress trong phpMyAdminTạo tài khoản Admin WordPress trong phpMyAdminTrước đây tôi có viết 1 bài viết giúp bạn tạo tài khoản admin trong WordPress với code PHP nhưng có 1 số khách hàng có nhắn với tôi rằng thêm code PHP vào file functions.php thì s… Read More
  • Tối ưu Google fonts với Cloudflare FontsTối ưu Google fonts với Cloudflare FontsCloudflare tôi đã có 1 bài viết nói vể lợi ích vô cùng to lớn của nó, ngoài tính năng bảo mật Cloudflare liên tục ra mắt các tính năng tối ưu website, mới đây họ ra mắt tính năng Cloudf… Read More
  • Đảo ngược thứ tự hiển thị field dữ liệu – ACFĐảo ngược thứ tự hiển thị field dữ liệu – ACFTrong bài viết trước tôi có hướng dẫn 1 bài viết check điều kiện để lấy data cuối trong repeater field – Advanced Custom Fields (ACF) và hiển thị trong bài này sẽ thay đổi thứ tự h… Read More

0 nhận xét:

Post a Comment

Chăm sóc tóc

DUNG DỊCH TẮM GỘI KHÔ – PH
90.000₫
MẶT NẠ TÓC PHỤC HỒI HƯ TỔN PREMIUM REPAIR MASK 180G – TSUBAKI
225.000₫
BỒ KẾT HOA BƯỞI 300ML – NCT3
340.000₫
DẦU XẢ THẢO DƯỢC BỒ KẾT SẢ CHANH HOA BƯỞI 300ML – TRƯỜNG HƯNG THỊNH
100.000₫
DẦU GỘI THẢO DƯỢC BỒ KẾT SẢ CHANH HOA BƯỞI 300ML – TRƯỜNG HƯNG THỊNH
100.000₫
SERUM DƯỠNG TÓC HOA BƯỞI GIẢM GÃY RỤNG 50ML – POMELO
84.000₫

Quảng cáo

Nổi bật

Cài đặt Thanh Toán Google adsense bằng ngân hàng Vietcombank

Sau khi đã đủ điều kiện rút tiền từ Google Adsense thì bạn cần phải thêm hình thức thanh toán để Google trả tiền cho bạn.Khi kiếm tiền trên ...

a-ads

Máy tính Laptop

44.990.000đ
Laptop LG Gram 2022 17Z90Q-G.AH76A5 (Core-i7 1260P/16GB/512GB/17″ WQXGA/Win 11/Xám)
24.790.000đ
Laptop LG Gram 2021 16ZD90P-G.AX54A5 (i5-1135G7/8GB RAM/512GB SSD/16″WQXGA/Dos/Trắng)
14.590.000đ
Laptop Acer Gaming Aspire 7 A715-42G-R4ST NH.QAYSV.004 (R5 5500U/8GB RAM/256GB SSD/15.6″FHD IPS/GTX1650 4GB/Win10) – Hàng chính hãng
15.190.000đ
Laptop Acer Aspire 3 A315-58G-50S4 (Core i5 1135G7/8GB RAM/512GB/15.6″FHD/MX350 2GB/Win 10/Bạc)
21.990.000đ
Laptop Acer Swift 5 SF514-55TA-59N4 NX.A6SSV.001 (i5-1135G7/16GB RAM/1TB SSD/14″FHD_Touch/Win10/Xanh) – Hàng chính hãng
14.890.000đ
Laptop Acer Aspire 5 A514-54-59QK (Core i5 1135G7/8GB RAM/512GB/14″FHD/Win 11/Vàng)

Vay Online

(x)
(x)
Day noi mi | Hoc noi mi | Noi mi dep | Trung tam day nghe toc | Day cat toc | Day nghe toc | Hoc cat toc | Hoc cat toc o Ha Noi | Hoc cat toc tai Ha Noi | Thuoc chua benh a sung
Dau goi Kafen | Dau xa Kafen | Giao trinh day cat toc | Mua ban rao vat | Dang rao vat | Dien dan rao vat | Rao vat mien phi | Trang rao vat

Mua Hang Gia Re / Cho Dien Tu / Mua Hang Online Uy Tin / Sim So Dep / Mua Hang Online / Dung Cu Cat / Dung Cu Cat Gia Re / Ban Buon Dung Cu Cat / Hoc Cat Toc / Dang Rao Vat / Dien dan Rao Vat / Trang Rao Vat / Day Noi Mi / Rao Vat Cho Tot / Quang Cao Rao Vat / Camera Quan Sat / Cac Website Rao Vat / My Pham Nganh Toc / Phu Kien Nganh Toc / Phuong Phap Tap Gym / Kiem Tien Tren Mang / Trung Tam Day Nghe Toc / VPS Gia Sieu Re / VPS Gia Sieu 10K / Thiet Ke Web Gia Re / Bat Dong San