PHP AMP Plugin - Download & Instructions

With the AMP for PHP plugin you can easily, completely automatically, create Google AMP pages for your websites.

Optimize your PHP website for mobile devices and the Google Mobile First Index without having to program your own AMPHTML version for each of your pages!

Test it out: Install. Activate. Finished!


Install the AMP PHP plugin


description

A tip before you start with the PHP-AMP plug-in installation: For some CMS solutions, amp-cloud.de offers special Google AMP plug-ins that are even easier to install and manage! - As an alternative to the "AMP for PHP plugin" , one of the following Google AMP plugins could be of interest to you:


Step-1: Download "AMP for PHP Plugin"

Download the current "AMP for PHP Plugin" version as a ZIP file from the following download link. - The ZIP file contains a folder called "amp" which contains all the files required to install and use the AMP plugin.


Step-2: Extract the "AMP for PHP Plugin" -ZIP-file

Unzip / extract the downloaded ZIP file.

  • After unpacking / extracting you should now have a "folder" with the name "/ amp /" in which the PHP-AMP plug-in files are located.

Step-3: Save PHP plugin files on the web server

Upload the unzipped folder with the name "/ amp /" into the root directory of your web server so that the folder can be reached on your website under the following URL:

  • www.DeineDomain.de/amp/

To test whether the folder is correctly stored on your web server, simply call up the following URL - If the installation is correct, you should see a message that tells you that your website uses the AMP plug-in from amp-cloud.de , otherwise the plugin is not installed correctly and you should go through the above steps again:

  • www.DeineDomain.de/amp/amp.php
    (Of course you have to replace www.yourdomain.de with the address of your website)

Step-4: insert the AMPHTML tag!

At last, include pushing each base, for which you want to provide AMP version, using one of the following variants a <link rel = "amphtml"> - a day in the <head> section of the corresponding base.

  • Version 1:

    <link rel = "amphtml" href = "http: // www.DeineDomain.de /amp/amp.php?url= IhrArtikelURL " />
    • Replace the "http: //" part with "https: //" if you are using HTTPS on your website
    • Replace the part "www.yourdomain.de" with the domain of your website
    • Replace the part "Your Article URL" with a UTF8 encoded URL of the respective subpage on which you incorporate the AMPHTML tag (incl. "Http: //" or "https: //")

      To encode a URL appropriately, you can use the following free online URL encoder: https://www.url-encode-online.rocks/

      Example for a UTF-8 encoded URL:
      https% 3A% 2F% 2Fwww.DeineDomain.de% 2FDeinPfad% 2FDeineDatei.php% 3Fparameter% 3DS% C3% BC% C3% 9F% 26sprache% 3DDE

      Example of a UTF-8 decoded URL:
      https://www.DeineDomain.de/DeinPfad/DeineDatei.php?parameter=Süß&sprache=DE

  • Variant 2:

    <link rel = "amphtml" href = " http: // ". $ _ SERVER ['HTTP_HOST']. "/ amp / amp.php? url =". urlencode (" http: // ". $ _ SERVER ['HTTP_HOST ']. $ _ SERVER [' PHP_SELF ']. "?". $ _ SERVER [' QUERY_STRING ']. ""). "" />
    • If you use HTTPS on your website, replace the two parts "http: //" with "https: //"

AMP PHP code example


code
<?php echo " <!DOCTYPE html> <html> <head> <title> Your meta title ... </title> <link rel="amphtml" href="https://".$_SERVER['HTTP_HOST']."/amp/amp.php?url=".urlencode("https://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."")."" /> </head> <body> Your body source code ... </body> </html> ;" ?>

Why use the AMP-PHP plugin?


power

The official AMP for PHP plugin from amp-cloud.de activates Accelerated Mobile Pages (AMP) on your own PHP websites, directly under your own host, as recommended by Google's AMP host guidelines !


Advertisement