Categories: AMP

How to Fix Invalid CSS Style AMP Error Due to Jetpack in WordPress

Jetpack is a wonderful plugin for WordPress which is bundled with some great features for novice WordPress users. However, the plugin also adds some CSS codes to the web pages which are not compatible with the new AMP HTML Code and results in AMP Validation errors. Given below is an example of an AMP error generated due to the Jetpack plugin.

As you can see from the error message, Jetpack is pointed out as the source of the error. Upon clicking on the error, the impacted code opens to the right and displays the following:

I have reached out to Jetpack to fix this problem in their upcoming releases as I find their plugin very useful. However, in the meantime, I had to disable the Jetpack plugin to remove this error message. To disable the Jetpack plugin, from your WordPress admin dashboard, go to Plugins > Installed Plugins and then locate Jetpack and disable it. The site becomes a valid AMP site after the Jetpack plugin is disabled.

A forum post on WordPress.org provides a solution to this problem. By adding the following code on your functions.php file, the problematic jetpack code will be stripped from your AMP pages.

add_filter( 'jetpack_implode_frontend_css', '__return_false' );

This method deals with updating the Functions file of your theme. Any update you make to the functions usually get overwritten during a theme update. As a result, it is strongly advised that you use a plugin like My Custom Functions before using the guide.

David

Share
Published by
David

Recent Posts

How to Fix Crowdstrike/BSOD Issue With Windows

If you are experiencing issues with your Windows system due to the Crowdstrike update, here's…

9 months ago

Koodo – Amazon Prime, Netflix and Disney+ for only $10 a month

Koodo customers in Canada can now get Amazon Prime, Netflix Standard with ads and Disney+…

10 months ago

We received your request for a single-use code to use with your Microsoft account

If you received an email with a single use code to login to your Microsoft…

1 year ago

How to fix The Microsoft account login server has detected too many repeated authentication attempts

If you are trying to login to your Microsoft account and getting the following error…

1 year ago

How to Keep Microsoft Teams Status Available All the Time

Most system admins set Microsoft Teams status to show Away when you are inactive for…

1 year ago

How to insert “\” if you don’t have a backslash key

If you are using a Windows computer and your keyboard doesn't have a backslash "\"…

1 year ago