Google’s Guinea Pig Experiments with the Webmaster is Not New. Read this Guide for Coding Stuffs on Google Accelerated Mobile Pages (AMP) and WordPress. We are sure that, Google Accelerated Mobile Pages (AMP) will also die like Google Authorship experiments.
Google Accelerated Mobile Pages (AMP) and WordPress : Do or Not Do!
Accelerated Mobile Pages (AMP) will make all websites looking almost the same, according to their desire. It is not safe to test the currently used plugins on Nginx PHP5-FPM WordPress setup. Already spamming with Accelerated Mobile Pages (AMP) has been started. It is unlikely that this AMP will stay with time. Watch for near about 2 years and then use the tested plugins by the others. Google knows about this new spam, which peoples are joking as AMPlified spam
:
1 | https://googlewebmastercentral.blogspot.in/2015/10/an-update-on-how-we-tackle-hacked-spam.html |
Google Accelerated Mobile Pages (AMP) and WordPress : Explaining the Idea
The idea is to use another sub page with same content with stripped off normal CSS, Js and use HTML markup, custom CSS and Js to show the content to the mobile, tablet users. It was better to ask for a common design for mobile version than trying an odd way. Take that the normal content URL is :
---
1 | https://thecustomizewindows.com/2015/12/nginx-wordpress-installation-guide-steps/ |
AMP URL should be :
1 | https://thecustomizewindows.com/2015/12/nginx-wordpress-installation-guide-steps/amp/ |
This is, not so easy with Nginx and PHP with WordPress Plugins. There are three main Plugins (all needed) for WordPress to do it –
1 2 3 | https://wordpress.org/plugins/amp/ https://wordpress.org/plugins/pagefrog/ https://wordpress.org/plugins/glue-for-yoast-seo-amp/ |
However, they may deliver huge trouble to many users. If they work you may try. If does not work, use somewhat grey way of coding.
Google Accelerated Mobile Pages (AMP) and WordPress : Testing Micro-format with StudioPress Genesis
StudioPress Genesis developers has psychological issue, by default, they never use Article but CreativeWorks (Genesis 2.2.6). As for StudioPress Genesis, as we discussed before the minor editing of StudioPress Genesis theme (not child theme) for error with mainContentOfPage
(at that time), you can check your markup for normal URL (without any /amp/
) with Google’s Structured Data Testing Tool.
It is likely to get :
1 2 3 4 | image:missing and required publisher:missing and required dateModified:missing and recommended mainEntityOfPage:missing and recommended |
mainEntityOfPage
, dateModified
recommended not required. So, we must add image
and publisher
.
If you hover over the error, you’ll see they are talking about AMP Article error. Which has referred here :
1 | https://developers.google.com/structured-data/carousels/top-stories? |
Also read it :
1 2 | https://www.ampproject.org/docs/reference/spec.html https://github.com/ampproject/amphtml/blob/master/spec/amp-tag-addendum.md |
If Nginx plus PHP does the works in easy to revert way, why you’ll think so much? Basically AMP is nothing but mobile pages. If you add :
1 | <link rel="amphtml" href="https://thecustomizewindows.com/2015/04/fix-wordpress-maincontentofpage-schema-error-genesis/" /> |
That becomes first step to say – “this is also AMP page”. Previously we talked about JSON-LD, JSON-LD is the easiest way to add data but in this context, you need to edit either Genesis’s that PHP file or add filter. Otherwise it will become a separate stuff. Google wants kind of this :
1 2 3 4 5 6 7 8 9 10 | "publisher": { "@type": "Organization", "name": "The Customize Windows", "logo": { "@type": "ImageObject", "url": "https://thecustomizewindows.com/logo.jpg", "width": 600, "height": 60 } } |
The logo image should be 600×60 pixels. We talked before on how to Add Itemprop image Schema in WordPress Posts. With HTML5, it is pathetic work! Adding this to theme or child theme’s function.php
or using our basic plugin to avoid adding snippets theme or child theme’s function.php :
1 2 3 4 5 6 7 8 | add_filter('the_content', 'tcw_add_itemprop_image_markup', 2); function tcw_add_itemprop_image_markup($content) { $string = '<img'; $replace = '<img itemprop="image"'; $content = str_replace( $string, $replace, $content ); return $content; } |
But, funnily it will return more error! Because the snippet will become :
1 | <img itemprop="image" src="https://thecustomizewindows.cachefly.net/wp-content/uploads/2016/02/List-of-Cheap-Dedicated-Server-Providers.png" alt="List of Cheap Dedicated Server Providers" width="699" height="707" class="aligncenter size-full wp-image-45258" srcset="https://thecustomizewindows.cachefly.net/wp-content/uploads/2016/02/List-of-Cheap-Dedicated-Server-Providers-297x300.png 297w, https://thecustomizewindows.cachefly.net/wp-content/uploads/2016/02/List-of-Cheap-Dedicated-Server-Providers.png 699w" sizes="(max-width: 699px) 100vw, 699px"/> |
ImageObject
, image.url
, image.height
, image.width
are their beloved terminologies now.
1 2 3 4 5 6 7 8 | add_filter('the_content', 'tcw_add_itemprop_image_markup', 2); function tcw_add_itemprop_image_markup($content) { $string = '<img'; $replace = '<img itemprop="ImageObject"'; $content = str_replace( $string, $replace, $content ); return $content; } |
It is error for AMP Rich Article. It is passing normal Articles Rich Snippets. The attribute item type has an invalid value is the error. That part we will correct in another article. That is fully new set of work. Otherwise web search will get confused.
Tagged With Accelerated Mobile Page , Accelerated mobile pages