Hreflang Manager

Documentation of the Hreflang Manager plugin for WordPress

Table of Contents

  1. Video Tutorials
  2. Installation (Single Site)
  3. Installation (Multisite)
  4. Update (Single Site)
  5. Update (Multisite)
  6. Introduction
  7. Sync
  8. Tutorials
  9. Credits
  10. Faq

1) Video Tutorials

This video series covers the functionalities of the Hreflang Manager plugin.

Please note that not all the aspects and implications are covered in this section. It’s recommended that you read the entire documentation before using this plugin in a production environment or asking for support to the plugin author.

2) Installation (Single Site)

With this procedure, you will be able to install the Hreflang Manager plugin on your WordPress website.

  1. Visit the Plugins -> Add New menu
  2. Click on the Upload Plugin button and select the zip file you just downloaded
  3. Click on Install Now
  4. Click on Activate Plugin

3) Installation (Multisite)

This plugin supports both a Network Activation (the plugin will be activated on all the sites of your WordPress Network) and a Single Site Activation in a WordPress Network environment (your plugin will be activated on a single site of the network).

With this procedure, you will be able to perform a Network Activation:

  1. Visit the Plugins -> Add New menu
  2. Click on the Upload Plugin button and select the zip file you just downloaded
  3. Click on Install Now
  4. Click on Network Activate

With this procedure, you will be able to perform a Single Site Activation in a WordPress Network environment:

  1. Visit the specific site of the WordPress Network where you want to install the plugin
  2. Visit the Plugins menu
  3. Click on the Activate button (just below the name of the plugin)

4) Update (Single Site)

With this procedure, you will be able to update the Hreflang Manager plugin:

  1. Visit the Plugins menu
  2. Click on Deactivate
  3. Update the plugin files with your favorite FTP client (delete the files of the old version and add the files of the new version)
  4. Click on Activate

5) Update (Multisite)

To update the plugin in all the sites of your WordPress Network, follow this procedure:

  1. Visit the Plugins menu
  2. Click on Network Deactivate
  3. Update the plugin files with your favorite FTP client (delete the files of the old version and add the files of the new version)
  4. Click on Network Activate

To update the plugin in single sites of the WordPress Network, follow this procedure:

  1. Visit the specific site of the WordPress Network where you want to update the plugin
  2. Visit the Plugins menu
  3. Click on Deactivate
  4. Update the plugin files with your favorite FTP client (skip this step if you have already updated the plugin files during the plugin update of another single site of the WordPress Network)
  5. Click on Activate

6) Introduction

Hreflang, explained in detail in this document provided by Google, gives search engines information on which language variations, language script variations, or geo-targeted versions of a page should be served to the users.

The Hreflang Manager plugin generates HTML link elements with included the hreflang attribute in the header of the pages available in the front-end of your WordPress installation.

With this plugin, you have two alternative ways to implement hreflang, from the Hreflang -> Connections menu and from the Hreflang Manager sidebar available in the post editor.

Connections Menu

The Connections Menu can be used to implement the hreflang attribute in any page (posts, pages, custom post types, homepage, categories, archives, etc.) of your WordPress website.

Hreflang Manager Sidebar

The Hreflang Manager sidebar, available in the post editor, can be used to implement the hreflang attribute on the posts (posts, pages, and custom post types).

To implement the hreflang attribute with the Hreflang Manager sidebar, follow this procedure:

  1. Visit a post
  2. Click on the Hreflang Manager button
  3. Open the Edit Connection modal window
  4. Enter the URLs of the alternative versions of the post with the related languages, scripts, and geo-targets
  5. Close the modal window
  6. Update the post

7) Sync

The sync feature allows you to set up hreflang in a single website of the network (Master) and automatically sync the other websites of the network. (Slaves)

In order to use this feature apply this procedure in the “Master” website:

  1. Visit the Sync tab available in the Hreflang -> Options menu
  2. Set the Status option to “Enabled”
  3. Set the Role option to “Master”

Then set up all the “Slave” websites with this procedure:

  1. Visit the Sync tab available in the Hreflang -> Options menu.
  2. Set the Status option to “Enabled”.
  3. Set the Role option to “Slave”.
  4. Set the frequency of the updates with the Frequency option. The plugin uses WP Cron to schedule the sync activity based on the defined frequency. The following frequency values are available: Hourly, Twice Daily, Daily, Weekly.
  5. Enter the REST API endpoint generated by the master website in the Master Endpoint option. This value should be equal to the URL of the master website plus the suffix “/wp-json/daext-hreflang-manager/v1/sync”. For example, if the master website is “https://example.com” the value of this option should be “https://example.com/wp-json/daext-hreflang-manager/v1/sync”.
  6. Set the Sync Mode option to “Based on Sync Options”. Note that by leaving the value of this option to “Exact Copy” the plugin makes an exact copy of the connections without adapting the Url to Connect value.
  7. Set the Language, Script, and Locale used in this website. The plugin uses this information to set the Url to Connect value of each connection imported from the master website.

Please note that the procedure used to sync the data is executed at periodic intervals (defined with the Frequency option) and also each time you save the plugin options in the Hreflang -> Options menu.

8) Tutorials

Connect two pages on the same website

Assume that inside a single WordPress installation, you have two versions of the same page, the first one is “Book” targeted for English users, and the second one is “Libro” targeted for Spanish users.

To generate the proper hreflang markup of the English version (the page “Book”), proceed to the Hreflang -> Connections menu and enter the following data:

To generate the hreflang markup of the Spanish version (the page “Libro”), enter the following data:

Connect the homepage of four different WordPress installations

In this example, we have to connect multiple websites. The website for non-targeted users where we want to place a language and country selector users is example.com.

We also own the German version de.example.com (for users that use the German language), the English version en.example.com (for users that use the English language), and the Canadian version ca.example.com (for users located in Canada that use the English language).

Proceed to the example.com WordPress back-end and enter the following data:

In the de.example.com WordPress back-end, enter the following data:

In the en.example.com WordPress back-end, enter the following data:

In the ca.example.com WordPress back-end, enter the following data:

9) Credits

This plugin makes use of the following resources:

10) Faq

Which versions of PHP are supported?

PHP 5.2 and later versions are supported.

Which versions of WordPress are supported?

WordPress 4.0 and later versions are supported.