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


A tip before you start with the PHP-AMP plug-in installation: For some CMS solutions, 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:


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 , otherwise the plugin is not installed correctly and you should go through the above steps again:

    (Of course you have to replace 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: // /amp/amp.php?url= IhrArtikelURL " />
    • Replace the "http: //" part with "https: //" if you are using HTTPS on your website
    • Replace the part "" 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:

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

      Example of a UTF-8 decoded URL:üß&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

<?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?


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