- If activating the additional SEO option and by default the Google PageSpeed module will create unwanted differences within the site, either visually or in terms of functionality, the various components of the module can be selectively deactivated by editing the .htaccess file. .
- Control panel access data (Plesk or cPanel) for editing the .htaccess file through File Manager.
- To check if the PageSpeed module is responsible for the problem encountered, you can disable the entire module by adding the following line to the .htaccess file in the site's root directory:
- After this step, if the site loads correctly, then the lines added above will be deleted and the specific item responsible for the wrong display will be identified.
- A first step would be to check the errors received when loading the page by accessing it with Developer Mode in the browser, the general shortcut for activation being F12 key for the usual browsers. For example, a loading error for JS or CSS will indicate a possible conflict with PageSpeed filters, which interact with these elements.
To disable a specific filter, the following rule will be added to the .htaccess file:
Where name_filter will be replaced with the desired identifier.
- Alternatively, the operation mode of PageSpeed can be changed, so that you can selectively activate each desired element by setting:
And then, the desired elements will be specified for activation, as follows:
Also, the name_filter will be replaced with the desired identifier.
- The default active elements when activating the additional SEO option are:
*These are also the identifiers that you can use in the .htaccess rules.
Adds a type element to the document if it does not already exist.
Combines multiple CSS elements into one.
Combines multiple JavaScrip elements into one.
Combine CSS wallpapers into a single Sprite.
Delete the empty spaces in HTML files, and ignores the tags: "
pre, script, style, textarea"
Upload images only when they become visible within the page.
Adds a "response header" for each "
meta" tag with an attribute "HTTP-equiv".
Extends cache time for images, CSS elements, and scripts that have not been optimized by signing URL with a content hash.
The following filters are active by default if extend cache is turned on:
For a higher level of control, the filters mentioned above can be activated individually
Rewrites URLs for resources that could not be minimized or processed from CSS files.
Recursively replace each
@import, rule with the contents of the imported CSS file to reduce the number of external requests.
Add small external CSS resources to the HTML document in inline form.
style" tags that contain only CSS @import to equivalent "
Rewrites small JS resources as inlines in the HTML document.
Rewrite CSS files to remove comments and excess free space.
Optimize images by editing and removing extra pixels.
Also, add small images as inline to the document.
Rewrite CSS from Style attributes if it contains the text "URL" using the configured rewrite_css filter.
If after reading and following the steps outlined in the article you are unable to successfully complete the described task or action, or if you have additional questions or concerns please do not hesitate to contact Hostico.