{"id":28769,"date":"2026-08-21T08:49:51","date_gmt":"2026-08-21T07:49:51","guid":{"rendered":"https:\/\/www.web-systems.pl\/how-to-speed-up-wordpress-improve-pagespeed-score\/"},"modified":"2026-08-21T08:49:51","modified_gmt":"2026-08-21T07:49:51","slug":"how-to-speed-up-wordpress-improve-pagespeed-score","status":"publish","type":"post","link":"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/","title":{"rendered":"How to speed up WordPress and improve your Google PageSpeed Insights score?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The speed of a website stopped being a purely technical detail for server administrators and developers a long time ago. Today it directly affects not only user comfort, sales effectiveness and the use of your advertising budget, but also the visibility of the site in Google and other search engines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is that WordPress optimization is often reduced to a simple pattern: install a cache plugin, run Google PageSpeed Insights and try at all costs to reach a score of 100\/100.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In practice, good optimization looks different.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First you have to establish <strong>what actually slows the site down<\/strong>, and only then improve specific elements: the server, the WordPress backend, CSS, JavaScript, images, fonts, third-party scripts or the DOM structure.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Spis tre\u015bci<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#What_is_page_speed_exactly\" >What is page speed, exactly?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#PageSpeed_Insights_is_more_than_a_score_from_0_to_100\" >PageSpeed Insights is more than a score from 0 to 100<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Core_Web_Vitals_%E2%80%93_more_important_than_chasing_100_points\" >Core Web Vitals &#8211; more important than chasing 100 points<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Does_page_speed_affect_SEO\" >Does page speed affect SEO?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#How_to_improve_WordPress_speed\" >How to improve WordPress speed?<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#1_Start_with_TTFB_and_the_server\" >1. Start with TTFB and the server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#2_Use_a_page_cache\" >2. Use a page cache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#3_An_object_cache_helps_the_WordPress_backend\" >3. An object cache helps the WordPress backend<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#4_Reduce_render-blocking_CSS_and_JavaScript\" >4. Reduce render-blocking CSS and JavaScript<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#5_Remove_unused_CSS\" >5. Remove unused CSS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#6_Do_not_overdo_JavaScript\" >6. Do not overdo JavaScript<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#7_Pay_attention_to_WordPress_plugins\" >7. Pay attention to WordPress plugins<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#8_Minify_CSS_and_JavaScript_but_do_not_expect_miracles\" >8. Minify CSS and JavaScript, but do not expect miracles<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#9_Keep_an_eye_on_the_number_of_requests_and_the_total_transfer\" >9. Keep an eye on the number of requests and the total transfer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#10_Images_are_one_of_the_biggest_sources_of_savings\" >10. Images are one of the biggest sources of savings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#11_Do_not_use_lazy_loading_for_everything\" >11. Do not use lazy loading for everything<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#12_Take_care_of_the_image_responsible_for_LCP\" >12. Take care of the image responsible for LCP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#13_Set_the_dimensions_of_images_and_other_elements\" >13. Set the dimensions of images and other elements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#14_Optimize_fonts\" >14. Optimize fonts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#15_Limit_third-party_scripts\" >15. Limit third-party scripts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#16_Enable_HTTP_compression\" >16. Enable HTTP compression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#17_Set_an_appropriate_browser_cache\" >17. Set an appropriate browser cache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#18_Avoid_unnecessary_redirects\" >18. Avoid unnecessary redirects<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#19_Control_the_size_of_the_DOM\" >19. Control the size of the DOM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#20_WooCommerce_requires_a_separate_approach\" >20. WooCommerce requires a separate approach<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#21_A_CDN_will_not_fix_a_slow_WordPress\" >21. A CDN will not fix a slow WordPress<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#22_Do_not_optimize_the_home_page_alone\" >22. Do not optimize the home page alone<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#23_Test_mobile_first_of_all\" >23. Test mobile first of all<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#24_Lab_data_and_user_data_are_two_different_things\" >24. Lab data and user data are two different things<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#25_Do_not_try_to_reach_100100_at_all_costs\" >25. Do not try to reach 100\/100 at all costs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#What_does_a_sensible_WordPress_optimization_process_look_like\" >What does a sensible WordPress optimization process look like?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Step_1_Measurement\" >Step 1. Measurement<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Step_2_Identify_the_biggest_problem\" >Step 2. Identify the biggest problem<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Step_3_Change_one_area\" >Step 3. Change one area<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Step_4_Measure_again\" >Step 4. Measure again<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Step_5_Watch_for_side_effects\" >Step 5. Watch for side effects<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/www.web-systems.pl\/en\/how-to-speed-up-wordpress-improve-pagespeed-score\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_page_speed_exactly\"><\/span>What is page speed, exactly?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There is no single value that says a page &#8220;loads in 2 seconds&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Page loading is a process. The browser first connects to the server, downloads the HTML, parses the document, downloads further resources, builds the DOM and the CSSOM, executes JavaScript, renders elements, and only then lets the user work freely with the interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why two pages can seemingly load in a similar amount of time, and yet one of them will be perceived as much faster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the user immediately sees the heading, the product photo and the &#8220;Buy&#8221; button, the page can feel fast even while less important elements are still being downloaded in the background.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If, on the other hand, all that is visible for the first two seconds is a white screen, the experience will be decidedly worse.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is exactly why Google does not limit performance measurement to a single load time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PageSpeed_Insights_is_more_than_a_score_from_0_to_100\"><\/span>PageSpeed Insights is more than a score from 0 to 100<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Google PageSpeed Insights analyzes a page using Lighthouse and presents both lab data and information about real user experience, if enough of that data is available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most visible part is the Performance score:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>0-49 &#8211; poor,<\/li>\n\n\n\n<li>50-89 &#8211; needs improvement,<\/li>\n\n\n\n<li>90-100 &#8211; good.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These values should not be treated like school grades, though.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A page scoring 92 does not have to be better in business terms than a page scoring 86. What is more, a Lighthouse test result can change between consecutive measurements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is far more important to understand <strong>what causes a poor score and how the page behaves for real users<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Core_Web_Vitals_%E2%80%93_more_important_than_chasing_100_points\"><\/span>Core Web Vitals &#8211; more important than chasing 100 points<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Google currently focuses above all on the three core metrics of Core Web Vitals:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>LCP &#8211; Largest Contentful Paint<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It measures the moment the largest meaningful element in the initial area of the page is displayed. Most often this will be a large photo, a banner or a piece of text.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good result is <strong>2.5 seconds<\/strong> at most.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>INP &#8211; Interaction to Next Paint<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It shows how quickly the page reacts to user actions, for example clicking a button, choosing a product variant or expanding a menu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good result is <strong>200 ms<\/strong> at most.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CLS &#8211; Cumulative Layout Shift<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It measures unexpected layout shifts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the user wants to click a button, but at the last moment an ad or an image appears above it and the button moves down, CLS will be high.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good result is <strong>0.1<\/strong> at most.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google evaluates these metrics based on the 75th percentile of visits, separately for mobile devices and desktops.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Does_page_speed_affect_SEO\"><\/span>Does page speed affect SEO?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, but it is worth understanding the relationship correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It does not work according to a simple pattern:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">page A has a PageSpeed score of 95, page B has 80, so page A will automatically rank higher in Google.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Google still tries above all to show the user the most relevant content. A good user experience, including page performance, is one of the elements that can help in search results, but it will not replace the quality of the content or its relevance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Performance optimization has a second effect as well, though, and often a more important one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A faster page means fewer users giving up before it loads, a quicker path to the product or the form, and less friction on the conversion path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why PageSpeed optimization is best treated first of all as <strong>user experience optimization<\/strong>, and only afterwards as technical SEO.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_improve_WordPress_speed\"><\/span>How to improve WordPress speed?<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">There is no single universal plugin that solves every problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The performance of <a href=\"https:\/\/www.web-systems.pl\/en\/wordpress-websites\/\" data-type=\"link\" data-id=\"https:\/\/www.web-systems.pl\/strony-wordpress\/\">WordPress<\/a> is the sum of many layers:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>the server infrastructure,<\/li>\n\n\n\n<li>the PHP and database configuration,<\/li>\n\n\n\n<li>WordPress itself and the plugins in use,<\/li>\n\n\n\n<li>the theme,<\/li>\n\n\n\n<li>HTML and the DOM,<\/li>\n\n\n\n<li>CSS,<\/li>\n\n\n\n<li>JavaScript,<\/li>\n\n\n\n<li>images and fonts,<\/li>\n\n\n\n<li>external services,<\/li>\n\n\n\n<li>cache and CDN.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The best results come from optimizing these elements in the right order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Start_with_TTFB_and_the_server\"><\/span>1. Start with TTFB and the server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the server needs two seconds just to generate the HTML, optimizing images will not solve the underlying problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TTFB, or Time to First Byte, is the time from the start of the request to receiving the first data from the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The result is affected by, among other things:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU performance,<\/li>\n\n\n\n<li>server load,<\/li>\n\n\n\n<li>the PHP version and configuration,<\/li>\n\n\n\n<li>MySQL\/MariaDB performance,<\/li>\n\n\n\n<li>the number of queries executed,<\/li>\n\n\n\n<li>WordPress plugins,<\/li>\n\n\n\n<li>external APIs,<\/li>\n\n\n\n<li>cache,<\/li>\n\n\n\n<li>the distance between the user and the server.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In Poland you can still come across WordPress sites running on cheap shared hosting alongside hundreds of other services. A fast internet connection on the user&#8217;s side will not help much if every PHP request has to wait for resources on an overloaded server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A properly configured VPS, hosting optimized for WordPress or cloud infrastructure can be a good solution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The name of the technology alone does not guarantee performance, though. A badly configured VPS can run far slower than a good shared hosting account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Use_a_page_cache\"><\/span>2. Use a page cache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress generates pages dynamically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A standard user visit can mean:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>starting PHP,<\/li>\n\n\n\n<li>loading WordPress,<\/li>\n\n\n\n<li>running the plugins,<\/li>\n\n\n\n<li>executing SQL queries,<\/li>\n\n\n\n<li>generating the HTML,<\/li>\n\n\n\n<li>sending the result to the browser.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If the result is identical for most users, running the whole operation on every visit is a waste of resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A page cache stores the finished HTML and can return it on subsequent requests without starting the entire application again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For content sites the difference can be very large.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The situation looks different in systems that contain user data, a cart, a checkout or a customer panel. There the cache has to be configured more carefully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_An_object_cache_helps_the_WordPress_backend\"><\/span>3. An object cache helps the WordPress backend<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A page cache and an object cache solve two different problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An object cache, for example one using Redis, lets you keep the results of frequently repeated operations and queries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can matter a great deal in more complex WordPress and WooCommerce installations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It does not automatically mean, however, that simply installing Redis will speed up every site. First you have to check where the bottleneck actually is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Reduce_render-blocking_CSS_and_JavaScript\"><\/span>4. Reduce render-blocking CSS and JavaScript<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The browser cannot draw the page straight away if it first has to download and process render-blocking resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A typical example is a large CSS file or synchronous JavaScript placed in the <code>&lt;head&gt;<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With CSS it is worth:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>reducing its size,<\/li>\n\n\n\n<li>removing unused rules,<\/li>\n\n\n\n<li>extracting critical styles,<\/li>\n\n\n\n<li>deferring CSS that is not needed at the top of the page.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Google points to reducing and deferring non-critical CSS as one of the ways to shorten the render delay of the LCP element.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript, in turn, can be loaded with <code>defer<\/code> or <code>async<\/code>, if the application logic allows it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should not, however, add <code>defer<\/code> to every script automatically. Plugins often depend on the order in which code is executed, and aggressive automatic optimization can break the site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Remove_unused_CSS\"><\/span>5. Remove unused CSS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An extensive theme may contain styles for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WooCommerce,<\/li>\n\n\n\n<li>forms,<\/li>\n\n\n\n<li>sliders,<\/li>\n\n\n\n<li>galleries,<\/li>\n\n\n\n<li>popups,<\/li>\n\n\n\n<li>tables,<\/li>\n\n\n\n<li>blog elements,<\/li>\n\n\n\n<li>widgets,<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">even if a given subpage does not use any of them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The browser still has to download and process the entire file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Chrome DevTools Coverage lets you check what portion of the CSS and JavaScript is actually used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In larger projects a good approach is to build separate asset bundles for different page types instead of loading one enormous file everywhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Do_not_overdo_JavaScript\"><\/span>6. Do not overdo JavaScript<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript is one of the most common reasons for a situation in which the page looks loaded but still responds slowly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The browser has to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>download the code,<\/li>\n\n\n\n<li>parse it,<\/li>\n\n\n\n<li>compile it,<\/li>\n\n\n\n<li>execute it.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">During that time the main thread can be busy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is particularly visible on phones with weaker processors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A large JavaScript application can work perfectly on a developer&#8217;s computer while having a very poor INP on a user&#8217;s several-year-old smartphone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why it is worth:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>removing unnecessary libraries,<\/li>\n\n\n\n<li>splitting the code into smaller chunks,<\/li>\n\n\n\n<li>loading features only when they are needed,<\/li>\n\n\n\n<li>limiting long JavaScript tasks,<\/li>\n\n\n\n<li>not initializing every component on the first render.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Pay_attention_to_WordPress_plugins\"><\/span>7. Pay attention to WordPress plugins<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The sheer number of plugins is not the best measure of performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thirty well-written small plugins can run faster than one heavy page builder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem appears when a plugin:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>runs expensive queries on every visit,<\/li>\n\n\n\n<li>loads its CSS on all pages,<\/li>\n\n\n\n<li>loads its JavaScript everywhere regardless of whether it is needed,<\/li>\n\n\n\n<li>communicates synchronously with an external API,<\/li>\n\n\n\n<li>runs a lot of code during <code>init<\/code>,<\/li>\n\n\n\n<li>performs tasks that should run asynchronously.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That is why, with more serious performance problems, you should profile the application instead of randomly disabling one <a href=\"https:\/\/www.web-systems.pl\/innowacyjne-rozwiazania-wtyczki-wordpress-dla-twojej-firmy\/\" data-type=\"post\" data-id=\"26902\">WordPress plugin<\/a> after another. It is more complicated technically, but the results are also much better.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Minify_CSS_and_JavaScript_but_do_not_expect_miracles\"><\/span>8. Minify CSS and JavaScript, but do not expect miracles<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Minification removes from the code what the browser does not need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>spaces,<\/li>\n\n\n\n<li>comments,<\/li>\n\n\n\n<li>formatting,<\/li>\n\n\n\n<li>some long names.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This reduces the size of the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is a good production practice, but these days the difference between a minified and a non-minified file, sent additionally with Brotli or GZIP compression, is often much smaller than it was a few years ago.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A far bigger improvement can come from <strong>not sending unnecessary code at all<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_Keep_an_eye_on_the_number_of_requests_and_the_total_transfer\"><\/span>9. Keep an eye on the number of requests and the total transfer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every additional resource means more work for the browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This does not mean you absolutely have to merge all files into one. With HTTP\/2 and HTTP\/3 that strategy often no longer makes sense.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is still worth limiting resources that add nothing, though.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Especially:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JavaScript libraries,<\/li>\n\n\n\n<li>fonts,<\/li>\n\n\n\n<li>trackers,<\/li>\n\n\n\n<li>social media widgets,<\/li>\n\n\n\n<li>iframes,<\/li>\n\n\n\n<li>videos,<\/li>\n\n\n\n<li>large images,<\/li>\n\n\n\n<li>duplicated libraries.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Optimization should be about reducing <strong>the amount of work performed<\/strong>, not merely the number shown in a report.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_Images_are_one_of_the_biggest_sources_of_savings\"><\/span>10. Images are one of the biggest sources of savings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A photo displayed on the page at 800 \u00d7 500 px should not be downloaded as a 5000 \u00d7 3000 px file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is one of the easiest mistakes to detect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress can generate different image sizes automatically, and the browser can pick the right version thanks to <code>srcset<\/code> and <code>sizes<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is also worth using modern formats:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WebP,<\/li>\n\n\n\n<li>AVIF.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In many cases they let you significantly reduce transfer while keeping good image quality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should not, however, mechanically convert everything to a single format. The result of the compression has to be judged on real material.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"11_Do_not_use_lazy_loading_for_everything\"><\/span>11. Do not use lazy loading for everything<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Lazy loading is very useful for images located far below the first screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;img\n    src=\"photo.webp\"\n    loading=\"lazy\"\n    width=\"800\"\n    height=\"600\"\n    alt=\"Photo description\"\n&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Today&#8217;s browsers support native <code>loading=\"lazy\"<\/code>, so in many cases an additional JavaScript library is no longer needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is one important exception, though.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do not lazy-load the main image above the fold<\/strong>, especially if it is the LCP element.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Such an image should start loading as early as possible. Google explicitly recommends that images in the initial viewport, especially the LCP one, should not be lazy loaded.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"12_Take_care_of_the_image_responsible_for_LCP\"><\/span>12. Take care of the image responsible for LCP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the largest element on the page is the main product photo or a hero banner, downloading it should start as early as possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem appears when the image:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>is set only as a <code>background-image<\/code> in CSS,<\/li>\n\n\n\n<li>is added only by JavaScript,<\/li>\n\n\n\n<li>has lazy loading applied incorrectly,<\/li>\n\n\n\n<li>is discovered by the browser too late.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In specific situations you can use, among other things:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fetchpriority=\"high\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or preloading the resource.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should not, however, preload a dozen or so graphics at once. If everything gets a high priority, priorities practically stop serving their purpose.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"13_Set_the_dimensions_of_images_and_other_elements\"><\/span>13. Set the dimensions of images and other elements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Elements should have dimensions the browser knows about.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For images these can be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>width=\"800\"\nheight=\"600\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks to this the browser can reserve the right amount of space before the file itself is downloaded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This reduces the risk of layout shifts, that is, of a worse CLS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A similar problem occurs with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ads,<\/li>\n\n\n\n<li>iframes,<\/li>\n\n\n\n<li>embeds,<\/li>\n\n\n\n<li>dynamic banners,<\/li>\n\n\n\n<li>elements loaded by JavaScript.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"14_Optimize_fonts\"><\/span>14. Optimize fonts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A web font is also a resource that has to be downloaded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A page that uses:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>4 font families,<\/li>\n\n\n\n<li>5 weights of each,<\/li>\n\n\n\n<li>italics,<\/li>\n\n\n\n<li>additional character sets,<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">can download far more data than is needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is worth limiting the number of variants and using WOFF2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another good practice is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>font-display: swap;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks to this the user can see the text in a fallback font before the target font is downloaded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the most critical fonts a preload is sometimes justified.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"15_Limit_third-party_scripts\"><\/span>15. Limit third-party scripts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A page can be well optimized and still run slowly because of code coming from other services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typical examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ad systems,<\/li>\n\n\n\n<li>analytics,<\/li>\n\n\n\n<li>chats,<\/li>\n\n\n\n<li>heatmaps,<\/li>\n\n\n\n<li>review widgets,<\/li>\n\n\n\n<li>social media,<\/li>\n\n\n\n<li>A\/B testing systems,<\/li>\n\n\n\n<li>YouTube videos,<\/li>\n\n\n\n<li>maps.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Each such element can download its own JavaScript, set up event listeners and run code on the main thread.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Polish company websites and online stores the problem often builds up gradually: first analytics is added, then Meta Pixel, Google Ads, a chat, a marketing automation tool and further widgets. Each of them looks small on its own, but together they can become one of the main sources of performance problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution can be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>removing services that are not needed,<\/li>\n\n\n\n<li>delaying their start,<\/li>\n\n\n\n<li>loading them only after an interaction,<\/li>\n\n\n\n<li>using lightweight placeholders instead of heavy iframes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"16_Enable_HTTP_compression\"><\/span>16. Enable HTTP compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">HTML, CSS, JavaScript, JSON, XML and other text formats compress very well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The server should therefore send them using, for example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Brotli,<\/li>\n\n\n\n<li>GZIP.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This reduces the amount of data sent between the server and the browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should not, on the other hand, compress again formats that already have their own effective compression, for example most images or videos.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"17_Set_an_appropriate_browser_cache\"><\/span>17. Set an appropriate browser cache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Static files that change rarely should not be downloaded again on every visit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This applies, among others, to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSS,<\/li>\n\n\n\n<li>JavaScript,<\/li>\n\n\n\n<li>images,<\/li>\n\n\n\n<li>fonts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The right headers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Cache-Control\nExpires\nETag\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">let the browser reuse previously downloaded resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For versioned files, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app.a87c913.js\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">you can use a very long cache lifetime, because a change of content produces a new file name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"18_Avoid_unnecessary_redirects\"><\/span>18. Avoid unnecessary redirects<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every redirect means an additional request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;example.com\n\u2193\nhttps:\/\/example.com\n\u2193\nhttps:\/\/www.example.com\n\u2193\nhttps:\/\/www.example.com\/pl\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">means several operations before the user reaches the actual document.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a single user visit this need not be a disaster, but similar chains inside the site, in CSS, JavaScript or ads can generate unnecessary delays.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Link directly to the target addresses.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"19_Control_the_size_of_the_DOM\"><\/span>19. Control the size of the DOM<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Page builders make it possible to create complicated layouts quickly, but they often generate very bloated HTML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A visually simple element can look like this in the code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div&gt;\n    &lt;div&gt;\n        &lt;div&gt;\n            &lt;div&gt;\n                &lt;div&gt;\n                    &lt;span&gt;Text&lt;\/span&gt;\n                &lt;\/div&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Multiplying a structure like this by hundreds of components sometimes grows the DOM to enormous proportions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A large DOM means more work during:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>parsing,<\/li>\n\n\n\n<li>style calculation,<\/li>\n\n\n\n<li>layout,<\/li>\n\n\n\n<li>updating elements with JavaScript.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That is why frontend optimization sometimes requires changing the way components are built, rather than installing yet another cache plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"20_WooCommerce_requires_a_separate_approach\"><\/span>20. WooCommerce requires a separate approach<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An online store is more demanding than a typical company website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here we have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the cart,<\/li>\n\n\n\n<li>the checkout,<\/li>\n\n\n\n<li>the user session,<\/li>\n\n\n\n<li>product variants,<\/li>\n\n\n\n<li>filters,<\/li>\n\n\n\n<li>the search engine,<\/li>\n\n\n\n<li>prices,<\/li>\n\n\n\n<li>stock levels,<\/li>\n\n\n\n<li>courier integrations,<\/li>\n\n\n\n<li>the payment system.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So you simply cannot cache everything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is worth analyzing separately:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the product listing,<\/li>\n\n\n\n<li>the product page,<\/li>\n\n\n\n<li>search,<\/li>\n\n\n\n<li>the cart,<\/li>\n\n\n\n<li>the checkout,<\/li>\n\n\n\n<li>the customer panel.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Often the biggest problem is not the product page itself, but the queries executed by filters, complex product variants or plugins that run on every request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"21_A_CDN_will_not_fix_a_slow_WordPress\"><\/span>21. A CDN will not fix a slow WordPress<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A CDN lets you deliver resources from infrastructure located closer to the user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It works great for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>images,<\/li>\n\n\n\n<li>CSS,<\/li>\n\n\n\n<li>JavaScript,<\/li>\n\n\n\n<li>fonts,<\/li>\n\n\n\n<li>other static files.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A CDN should not be treated as a cure for a slow backend, though.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If WordPress needs three seconds to generate the HTML document, a CDN can partly mask the problem with cache, but it does not remove its cause.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First you have to establish what is really slowing the application down.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"22_Do_not_optimize_the_home_page_alone\"><\/span>22. Do not optimize the home page alone<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is one of the more common mistakes in PageSpeed work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A company optimizes the homepage to a score of 95, but a user coming from Google straight to an article or a product page gets a completely different experience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should test representative types of subpages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the home page,<\/li>\n\n\n\n<li>a landing page,<\/li>\n\n\n\n<li>an article,<\/li>\n\n\n\n<li>a category,<\/li>\n\n\n\n<li>a product,<\/li>\n\n\n\n<li>a form,<\/li>\n\n\n\n<li>the cart,<\/li>\n\n\n\n<li>the checkout.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Every template can have different problems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"23_Test_mobile_first_of_all\"><\/span>23. Test mobile first of all<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The desktop score very often looks good even on an averagely optimized site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mobile devices reveal problems faster:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a weaker processor,<\/li>\n\n\n\n<li>less memory,<\/li>\n\n\n\n<li>a slower connection,<\/li>\n\n\n\n<li>a higher cost of executing JavaScript.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This is exactly why PSI analysis should always start with the mobile version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"24_Lab_data_and_user_data_are_two_different_things\"><\/span>24. Lab data and user data are two different things<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A single PageSpeed test is a simulation run under specific conditions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Field data, on the other hand, shows the experience of real users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is a very important distinction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is possible to get a poor result in a single lab test and at the same time have good Core Web Vitals for users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reverse situation is possible as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why, when analyzing a larger site, it is worth combining:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PageSpeed Insights,<\/li>\n\n\n\n<li>Chrome DevTools,<\/li>\n\n\n\n<li>Lighthouse,<\/li>\n\n\n\n<li>Search Console,<\/li>\n\n\n\n<li>CrUX data,<\/li>\n\n\n\n<li>your own Real User Monitoring.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"25_Do_not_try_to_reach_100100_at_all_costs\"><\/span>25. Do not try to reach 100\/100 at all costs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PageSpeed is a diagnostic tool, not a business goal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can spend dozens of hours moving the score from 96 to 100 without giving the user any noticeable improvement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At the same time, improving LCP from 5 seconds to 2 seconds can matter a great deal, even if the final Lighthouse score is still not perfect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is why the priorities should look roughly like this:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>remove serious user experience problems,<\/li>\n\n\n\n<li>improve Core Web Vitals,<\/li>\n\n\n\n<li>remove technical bottlenecks,<\/li>\n\n\n\n<li>optimize the largest resources,<\/li>\n\n\n\n<li>and only afterwards deal with cosmetic score tweaks.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_does_a_sensible_WordPress_optimization_process_look_like\"><\/span>What does a sensible WordPress optimization process look like?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of installing several plugins at once, it is worth running the process step by step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Measurement\"><\/span>Step 1. Measurement<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PageSpeed for mobile and desktop,<\/li>\n\n\n\n<li>Core Web Vitals,<\/li>\n\n\n\n<li>TTFB,<\/li>\n\n\n\n<li>the request waterfall,<\/li>\n\n\n\n<li>the transfer size,<\/li>\n\n\n\n<li>the amount of JavaScript,<\/li>\n\n\n\n<li>the amount of CSS,<\/li>\n\n\n\n<li>the LCP element.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Identify_the_biggest_problem\"><\/span>Step 2. Identify the biggest problem<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Is the limitation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the backend,<\/li>\n\n\n\n<li>the LCP image,<\/li>\n\n\n\n<li>CSS,<\/li>\n\n\n\n<li>JavaScript,<\/li>\n\n\n\n<li>third-party scripts,<\/li>\n\n\n\n<li>fonts,<\/li>\n\n\n\n<li>the HTML structure?<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Do not fix everything at once.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Change_one_area\"><\/span>Step 3. Change one area<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>configure the cache,<\/li>\n\n\n\n<li>optimize the hero image,<\/li>\n\n\n\n<li>remove unnecessary JS,<\/li>\n\n\n\n<li>improve TTFB.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Measure_again\"><\/span>Step 4. Measure again<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check whether the change actually had an effect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Watch_for_side_effects\"><\/span>Step 5. Watch for side effects<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Optimization also has to include functional testing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the changes you have to check, among other things:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>forms,<\/li>\n\n\n\n<li>menus,<\/li>\n\n\n\n<li>popups,<\/li>\n\n\n\n<li>the cart,<\/li>\n\n\n\n<li>the checkout,<\/li>\n\n\n\n<li>logging in,<\/li>\n\n\n\n<li>payments,<\/li>\n\n\n\n<li>tracking.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A score of 100\/100 has no value at all if the checkout stops working after the optimization.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Optimizing WordPress is not about finding one magic setting in Google PageSpeed Insights.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good performance comes from many elements working together:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a fast backend,<\/li>\n\n\n\n<li>the right cache,<\/li>\n\n\n\n<li>a reasonable amount of CSS and JavaScript,<\/li>\n\n\n\n<li>optimized images,<\/li>\n\n\n\n<li>correct font loading,<\/li>\n\n\n\n<li>limiting third-party scripts,<\/li>\n\n\n\n<li>a good HTML structure,<\/li>\n\n\n\n<li>an appropriate server configuration.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">PageSpeed Insights is a very good starting point, because it helps to find potential problems. It should not be treated, however, as a machine that tells you what unconditionally has to be changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The real user remains the most important thing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the page shows the most important content quickly, reacts to interactions immediately, does not shift elements while loading and works stably on mobile devices as well, the optimization is doing its job.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And a <a href=\"https:\/\/www.web-systems.pl\/en\/fast-websites\/\" data-type=\"link\" data-id=\"https:\/\/www.web-systems.pl\/szybkie-strony-www\/\">high PageSpeed score for the site<\/a> is then a consequence of a well-built, fast website, not a goal in itself.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>The speed of a website stopped being a purely technical detail for server administrators and developers a long time ago. Today it directly affects not only user comfort, sales effectiveness and the use of your advertising budget, but also the visibility of the site in Google and other search engines. The problem is that WordPress [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":28479,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[306,253,6,472],"tags":[22,30,794,795,150,283,186],"class_list":["post-28769","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-poradniki","category-projektowanie-stron","category-web-development","category-wordpress","tag-google","tag-optymalizacja","tag-pagespeed","tag-psi","tag-web-development","tag-wordpress","tag-wydajnosc"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts\/28769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/comments?post=28769"}],"version-history":[{"count":0,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/posts\/28769\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/media\/28479"}],"wp:attachment":[{"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/media?parent=28769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/categories?post=28769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.web-systems.pl\/en\/wp-json\/wp\/v2\/tags?post=28769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}