Ask questions about WordPress courses

How to disable srcset in wordpress

Starting from version 4.4 in WordPress, the default parameter is embedded srcset which allows you to adapt the pictures that are directly in the template. But as practice has shown, Google PageSpeed ​​Insights doesn't recognize this parameter correctly and lowers the page load quality.. Most likely, this is related to, that not all mobile devices have already learned to support this format. If at the time of reading this article you are experiencing the same problems, I recommend trying to disable this setting.

Disabling srcset in WordPress is very easy, you need to go to your theme directory /wp-content/themes/{your-theme}/functions.php and write a special filter in this file. I am posting an example below..

That's all there is to it. If you want to read what google says about the srcset attribute, go and read here. If anyone finds information, how to improve this setting with PageSpeed, write in the comments, I will be happy with new information and ready to redo the article.


Купить хостинг WordPress
WordPress tutor
Online tutoring services. List of courses I teach
  • Basic web design course;
  • Site layout;
  • General course on CMS WordPress and continuation of the course on template development;
  • Website development in PHP.
Read more on the page WordPress tutor
*/

Nikolaenko Maxim

Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Templates for WordPress
The best hosting in Ukraine
Stable hosting for Drupal