Chanhe amp query with subdirectory /amp
-
I need to change the query ?amp to /amp
Since the plugin changed the path, google discover can’t see my website with AMP version but only in normal non amp mobile version.
What function should I use to reset all links? In my opinion the query ?amp is not present in sitemap, in this way discover can’t show my website with AMP.
I made the blog theme with amp support and there is no error.
Please help me fix this, thanks
My website: https://viaggiarealverde.it/
The page I need help with: [log in to see the link]
-
I’m looking at this non-AMP URL here: https://viaggiarealverde.it/2020/07/questo-canale-parigino-e-stato-svuotato-dopo-200-anni-cosa-hanno-trovato-allinterno-le-foto/
This page has on it:
<link rel="amphtml" href="https://viaggiarealverde.it/2020/07/questo-canale-parigino-e-stato-svuotato-dopo-200-anni-cosa-hanno-trovato-allinterno-le-foto/?amp">
It is pointing to a valid AMP page: https://viaggiarealverde.it/2020/07/questo-canale-parigino-e-stato-svuotato-dopo-200-anni-cosa-hanno-trovato-allinterno-le-foto/?amp
Is the issue that you are seeing in search results that Google is still linking to the URLs ending in
/amp/
like https://viaggiarealverde.it/2020/07/questo-canale-parigino-e-stato-svuotato-dopo-200-anni-cosa-hanno-trovato-allinterno-le-foto/amp/ ?If so, then this would just be because Googlebot hasn’t re-crawled those URLs yet. When it has done so, it will obtain the updated
amphtml
link and index the?amp
ones. In any case, the AMP plugin is automatically redirecting from/amp/
to?amp
so there won’t be any broken links.In any case, when I google for
site:viaggiarealverde.it Questo canale parigino è stato svuotato dopo 200 anni: cosa hanno trovato all’interno? Le Foto
on mobile, I am presented with a link to the AMP version (notice the AMP badge).Clicking on the result opens the page in the Google AMP viewer as expected:
The AMP page with
?amp
successfully loads via the AMP Cache: https://viaggiarealverde-it.cdn.ampproject.org/c/s/viaggiarealverde.it/2020/07/questo-canale-parigino-e-stato-svuotato-dopo-200-anni-cosa-hanno-trovato-allinterno-le-foto/?amp- This reply was modified 4 years, 2 months ago by Weston Ruter.
I think I didn’t explained well what is happening on my website, you marked the thread as resolved but it’s not.
The change from /amp to ?amp was made in July. The crawler should have already detected all the changes.
I made this test and everything seemed fine.
The problem is only on DISCOVER.
As you can see in the attached pic the article is showed with little thumbnail even if all pics size are fine and checked, there is no amp badge, indeed clicking on link show me the website NON AMP version.
Before the url change everything was showing fine on discover, like big thumbnail.
The url you see on screenshot is: https://viaggiarealverde.it/2020/09/interpretava-hobie-il-figlio-di-mitch-in-baywatch-oggi-ha-un-corpo-muscoloso-barba-e-capelli-lunghissimi-foto/
The last fix I can try is about the URL. Do you suggest the code to make everything correct?
Sorry, I am not sure. This would be a question for Google Search (and/or Google Discover) as I am not involved with indexing. Everything looks good in regards to AMP. The
amphtml
link is working, there are no AMP validation errors, and rich snippets look good.I do see that article showing up as AMP on mobile search results. When I search for “Noto per aver vestito i panni di Hobie Buchannon in Baywatch” I see this (notice the AMP badge):
You may find the AMP Indexing FAQs helpful. Or look at the AMP status report. See also Google Discover and your website. Or reach out to the Webmasters Help Community.
- This reply was modified 4 years, 2 months ago by Weston Ruter.
I understand it’s not a plugin issue, however Discover seems to have trouble indexing queries.
I have already opened a topic in google suport before writing here.
In the future, can you have the user choose which of the two methods to use?
Can you tell me the correct way to restore sthe subdirectory /amp?
Sorry I’m pushy but that’s the only option I haven’t tried.Another weired thing is that the home page site is stopped to 28 august
https://www.google.com/amp/s/viaggiarealverde.it/- This reply was modified 4 years, 2 months ago by llmanull.
In the future, can you have the user choose which of the two methods to use? Can you tell me the correct way to restore sthe subdirectory /amp?
We do have an issue open to allow the URL to be customized, however we are going to be defaulting to
?amp=1
for all modes. See https://github.com/ampproject/amp-wp/issues/2204Another weired thing is that the home page site is stopped to 28 august
https://www.google.com/amp/s/viaggiarealverde.it/That would be another question for Google Search but it’s likely just that the AMP Cache is not updating. There are various issues reported regarding the AMP Cache: https://github.com/ampproject/amphtml/issues/24326
In order to ensure that such frequently-updated pages are fresh, an option which will be available soon is “off cache AMP”: https://github.com/ampproject/amphtml/issues/29296
We may enable that by default in the AMP plugin for any non-singular posts and pages.
In the meantime, you could disable AMP for the homepage. This can be done via the Supported Templates section of the AMP settings screen.
So because you said there are issue with customization, can I install a previous release from Here?
What is the last release supporting ‘/amp’?
Tnx for support.
I do not recommend downgrading.
If you want to try forcing the
amphtml
links to use/amp/
instead of?amp
, you can try the following plugin code, although requesting/amp/
will still redirect to?amp
when in Transitional mode.add_action( 'template_redirect', static function () { if ( ! is_singular() || ! function_exists( 'amp_is_available' ) || ! amp_is_available() || ! get_option( 'permalink_structure' ) || is_post_type_hierarchical( get_queried_object()->post_type ) || 'attachment' === get_post_type( get_queried_object_id() ) ) { return; } remove_action( 'wp_head', 'amp_add_amphtml_link' ); add_action( 'wp_head', function () { $amp_url = preg_replace( '/#.*/', '', get_permalink( get_queried_object_id() ) ); $amp_url = trailingslashit( $amp_url ) . user_trailingslashit( amp_get_slug(), 'single_amp' ); printf( '<link rel="amphtml" href="%s">', esc_url( $amp_url ) ); } ); } );
Thanks so much.
I tried the local downgrade but the custom theme doesn’t work, to get things done quickly I changed plugins. If the url change works then I return to the official plugin making this change. Meanwhile, I try it locally.
- This reply was modified 4 years, 2 months ago by llmanull.
@westonruter
For completeness I tell you that, as soon as the url changed, DIscover immediately viewed the site in AMP.
I think that the customization of the URL is an aspect to be taken into consideration for the development of the plugin.We are planning to allow for URL customization per above: https://github.com/ampproject/amp-wp/issues/2204
We’re going to try to investigate why the URL change caused the issue with Discover. If need be, would you be willing to switch back to
?amp
so we would be able to debug?Sorry but I can not. Unfortunately it is a production site, the lack of the big picture on amp creates problems for me.
OK, please subscribe to the GitHub issue for updates on when URL customization will be available: https://github.com/ampproject/amp-wp/issues/2204
- The topic ‘Chanhe amp query with subdirectory /amp’ is closed to new replies.