You don't have to worry so much about google pagespeed as your site goes fast by itself. There are many factors that can cause your page to go slow. We have most of the problem in the lack of configuration of the hosting and in a bad configuration of wordpress. If you are worried about having a good score in the pagespeed, I recommend that you put a service like nitropack, in a moment it will do magic for you, it will configure your site and you will have all the score to more than 90 on desktop and mobile.
However, if what you are concerned about is that the page is 100% functional and go like lightning ... your concern is to have a good configuration both in the hosting and in wordpress. The first thing I would do is completely rule out shared hosting, since it will only give you problems. If that is not your case and you have a server for you, it is to check that you have Nginx installed and configured. It is important, because the PHP load is constant and does not interrupt or call like Apache. The second step is to install and configure on your Redis server. Thus the database load, caching, session management, pub / sub and it will distribute the load a lot (you will have to configure it in the hosting and in wordpress).
Once you have your host ready, as Chris37 said very well, we would start with autooptimize, cdn, some OPcache plugin and image optimizer.
P.D. If you want to eliminate google fonts, with a small code in the functions.php of the active theme you can completely deactivate the loading of Google Fonts, even if they are “called” from the web layout.
| add_filter( 'style_loader_src', function($href){
if(strpos($href, "//fonts.googleapis.com/") === false) {
return $href;
}
return false;
}); |
You can also asynchronize them so that the load is asynchronous.
You must insert this script in the header of the website, between the <head> </head> tags of the active theme, or through a plugin to put scripts in the header:
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Noto+Serif:400,400italic,700,700italic' ] } // Example
};
(function() {
var wf = document.createElement('script');
wf.src = '
https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
Remember that you must customize it with the fonts that you use right where in the code it says the comment "Example". Otherwise, the code will not work.