How to Fix the tag ‘amp-ad extension .js script’ is missing or incorrect

The tag ‘amp-ad extension .js script’ is missing or incorrect: AMP or Accelerated Mobile Pages is a trending framework developed by Google. The basic aim of AMP is to make the web pages load faster on mobile devices. Since the mobile searches are outnumbering the desktop searches by a large margin, the speed at which web pages load on mobile devices is of utmost importance for the future. For this very reason, Google has developed AMP.

Honestly, the AMP feature is experiencing mixed reviews from the users. It is turning out very well for few folks but for some, it is deteriorating their visitors or earnings. The whole idea behind AMP is to reduce the size of CSS and JavaScript and only keep the minimum required content. AMP can be easily enabled in WordPress websites various plugins which are readily available for free.

How I got “tag ‘amp-ad’ extension .js script is missing or incorrect ” Error?

So, it was just another day when I came back home after office. A notification popped up on my phone notifying New AMP issue detected for the site. When I opened up the mail, I could see a descriptive error quoting the following:

The tag ‘amp-ad extension .js script’ is missing or incorrect, but required by ‘amp-ad’. This will soon be an error.

Honestly, I had no idea about this error. I had to go through various blog posts and forums to get to the right and concrete answer. So, I thought of putting everything together so that it can be beneficial for our readers.

How to fix The tag ‘amp-ad extension .js script’ is Missing or Incorrect

The steps to fix the tag ‘amp-ad extension .js script’ is missing or incorrect are fairly easy to implement. We have tried to make things easier for you by mentioning even the minute details. We have also placed screenshots for every step to make things clear and visible. So, let us start fixing the issue now.

  • Go to your WordPress admin panel and Sign In to it using your username and password.
  • From the left menu bar, search for Appearance option.
amp-ad extension .js script
  • Hover over the Appearance option and select Theme Editor.
amp-ad extension .js script
  • Here, you can edit your theme files. From the right, search for the file functions.php and click on it. This will open the functions.php file in the editor.
amp-ad extension .js script
  • Now copy and paste the following code at the end of functions.php file.
add_filter( 'amp_post_template_data', function( $data ) {
	$data['amp_component_scripts'] = array_merge(
		$data['amp_component_scripts'],
		array(
			'amp-ad' => 'https://cdn.ampproject.org/v0/amp-ad-latest.js',
		)
	);
	return $data;
} );
  • Once you have pasted the code in the file, click on the Update File button.
amp-ad extension .js script

Validate the Fix you Just Implemented

Alright. So, it is good that you have made the fix real quick. However, even after doing so, you will still see the warning in Google Search Console. Google won’t know right away that you have implemented the fix. You will have to tell Google that by yourself. This will hardly take a minute or two. Just follow these steps:

  • From the left menu panel, click on AMP option.
amp-ad extension .js script
  • Now click on Valid with warnings tab as shown in the screenshot below.
amp-ad extension .js script
  • Click on the warning quoting ‘The tag ‘amp-ad extension .js script’ is missing or incorrect, but required by ‘amp-ad’. This will soon be an error.
amp-ad extension .js script
  • Now, tap on Validate Fix button.
amp-ad extension .js script

This will start the validation process. It may take around 3-5 days or even a week. You can follow the same path to view the validation progress for this particular error message. After a week or so, this error message will disappear and you should be good to go.

Also Read: How to fix Google AdSense Earnings at Risk message

So, these were the detailed analysis and steps to fix the tag ‘amp-ad extension .js script’ is missing or incorrect, but required by amp-ad. Hope you liked this article and found it useful. However, if you are still stuck and need some assistance, feel free to reach out to us via comments. The comments section is placed right below this post. Thanks.

Leave a Reply