Thing with AMP and pages & rewrite endpoints

AMP bugs & improvements on | Trello Add support for Archive / Authors / Tags and pagination by gabrielperezs · Pull Request #313 · Automattic/amp-wp Rewrite API/add rewrite endpoint « WordPress Codex Add rewrite endpoint to author page + pagination - WordPress Development Stack Exchange

Datenschutz | - smart shopping Comparing Automattic:master…gabrielperezs:master · Automattic/amp-wp Add support for pages by technosailor · Pull Request #188 · Automattic/amp-wp Topic: /amp/ permalink not working? « Forums Automattic/amp-wp: WordPress plugin for adding AMP support

Rewrite endpoints API – Make WordPress Plugins Topic: Custom rewrite approach with add_rewrite_endpoint() « Forums wp refresh permalinks add rewrite endpoint - Google Search Rewrite endpoints API – Make WordPress Plugins A (Mostly) Complete Guide to the WordPress Rewrite API - PMG - Advertising Agency

Improve official AMP plugin

WordPress & AMP: part II • Yoast

  • Glue for Yoast SEO & AMP is used for:

    1. Enable/disable AMP on content types. Very simple.
    2. Google Analytics Integration. Gives perfect total control!
  • AMP Post Script

    1. AMP Menu Support, perfectly implemented Other tweaks, not needed: Google Analytics to AMP, Post type support, Remove footer (removed from plugin for now)


Plugin that add no extra value to WP AMP:

Shortcodes and AMP:

How to force update of AMP pages in AMP Cache?

First, extract all AMP pages with Screaming Frog’s custom extraction using //link[@rel='amphtml']/@href as XPath, and save URLs as file files.txt.

Based on this document: Update AMP Content, simplest to do is this:

And we can also do this (the only way to delete content):

So, let’s try to automate reading list of URLs from file:

sed -e 's/^https:\/\///' files.txt | xargs -i curl -sL -w "%{http_code} %{url_effective}\\n" https://\{\} -o /dev/null


sed -e 's/^https:\/\//https:\/\//' files.txt | xargs -i curl -sL -w "%{http_code} %{url_effective}\\n" \{\} -o /dev/null

Linux, in parallel:

sed -e 's/^https:\/\//https:\/\//' files.txt | \
parallel --no-notice --pipe -L 30 \
curl -sL -w "%{http_code} %{url_effective}\\n" \{\} -o /dev/null

This is my final process:

# Just read URLs
sed -e 's/^https:\/\//https:\/\//' files.txt | xargs -i curl -sL -w "%{http_code} %{url_effective}\\n" \{\} -o /dev/null

# Update cache, in AMP Cache URL format
sed -e 's/^https:\/\///' files.txt | xargs -i curl -sL -w "%{http_code} %{url_effective}\\n"\{\} -o /dev/null

# Slightly faster cache update, in Update ping format
sed -e 's/^https:\/\///' files.txt | xargs -i curl -sL -w "%{http_code} %{url_effective}\\n"\{\} -o /dev/null

That’s it.


date 01. Jan 0001 | modified 10. Jun 2024
filename: Task - AMP