“Hreflang Flags” Documentation by “DAEXT” v1.10


“Hreflang Flags”

Created: 21/07/2020
By: DAEXT
Email: support@daext.com

Thank you for using Hreflang Flags. If you have any questions that are beyond the scope of this help file please contact us via email or with the contact form available in our CodeCanyon Profile.


Table of Contents

  1. Video Tutorials
  2. Installation (Single Site)
  3. Installation (Multisite)
  4. Select the Source
  5. Configure the Languages
  6. Generate the Fixed Flags
  7. Generate the flags in a Widget Area
  8. Generate the flags in a Post, Page or Custom Post Type
  9. Add the flags in a Template File
  10. Credits
  11. FAQ

A) Video Tutorials

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

Please note that not all the aspects and implications are covered in this section, it's recommended that you read the entire documentation (FAQ included) before using this plugin in a production environment or asking for support to the plugin author.


B) Installation (Single Site)

With this procedure you will be able to install the Hreflang Flags 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

C) 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

D) Select the Source

Hreflang Flags analyzes the link elements in the header that have the hreflang, href and rel attributes and retrieves the information used to generate the flags, which are:

With the Hreflang Flags -> General -> Source option you can determine how these information will be used to generate the flags. Use this table as a reference:

Language and Locale The flag associated with the language and the flag associated with the locale will be both displayed and enclosed in a single link element.
Language If the ISO-639-1 code is available the flag associated with the language will be displayed. If the ISO-639-1 code is not available no flag is displayed for the considered link element.
Language (priority) If the ISO-639-1 code is available the flag associated with the language will be displayed. If the ISO-639-1 code is not available the flag associated with the locale will be displayed (if the ISO-3166-1 alpha-2 code is available).
Locale If the ISO-3166-1 alpha-2 code is available the flag associated with the locale will be displayed. If the ISO-3166-1 alpha-2 code is not available no flag is displayed for the considered link element.
Locale (priority) If the ISO-3166-1 alpha-2 code is available the flag associated with the locale will be displayed. If the ISO-3166-1 alpha-2 code is not available the flag associated with the language will be displayed (if the ISO-639-1 code is available).

Please note that the ISO-639-1 code is a standard used to classify languages and that the ISO-3166-1 alpha-2 is standard used to classify regions. The two standard are used by this plugin because are the same used to implement hreflang, as specified in the guidelines provided by Google.


E) Configure the Languages

Hreflang Flags comes by default with 241 flags associated with the regions defined with the ISO 3166-1 alpha-2 specification. If the flags are generated using the region value of your implementation of hreflang there is a flag for each region, so there is no configuration required.

If instead the flags are generated using the language value of your implementation of hreflang you have to associate the used languages with the related regions. This task can be completed by using the Hreflang Flags -> Options -> Languages tab.


F) Generate the Fixed Flags

To generate the fixed flags proceed as follows:

  1. Visit the Hreflang Flags -> Fixed menu
  2. Set the Enable option to "Yes"
  3. Use the other options available in this tab to customize the look and the behavior of the fixed flags
  4. Save your changes by clicking on the Save Changes button

G) Generate the flags in a Widget Area

To generate the flags in a widget area proceed as follows:

  1. Visit the Appearance -> Widget menu
  2. Add the Hreflang Flags widget in a widget area
  3. Set a custom title, specify the size of the flags and customize the other aspects of the widget with the available options
  4. Save your changes with the Save button


H) Generate the flags in a Post, Page or Custom Post Type

To generate the flags in a post, page or custom post type proceed as follows:

  1. Edit a post, page or custom post type
  2. Place the cursor where you want to insert the flags
  3. Click the Hreflang Flags TinyMCE button
  4. Customize the look of the flags with the available options
  5. Click the Add Flags button to insert the shortcode
  6. Save the post, page or custom post type


I) Add the flags in a Template File

To add the flags in a template file of your WordPress theme use the hreflang_flags() function in a PHP context, for example:
<p>Theme HTML</p>
<?php hreflang_flags(); ?>
<p>Other Theme HTML</p>

This function accepts the following parameters:


J) Credits

This plugin makes use of the following resources:


K) FAQ

Which versions of PHP are supported?

PHP 5.3 and later versions are supported.

WordPress 4.0 and later versions are supported.