WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Add Meta Tags

Add basic meta tags and also Opengraph, Schema.org Microdata, Twitter Cards and Dublin Core metadata to optimize your web site for better SEO.

Add-Meta-Tags (AMT) adds metadata to your content, including the basic description and keywords meta tags, Opengraph, Schema.org, Twitter Cards and Dublin Core metadata. It is actively maintained since 2006 (historical Add-Meta-Tags home).

Goals

The goals of the Add-Meta-Tags plugin are:

  • provide efficient, out-of-the-box search engine optimization (SEO) on a web site powered by WordPress.
  • be customizable, yet simple and easy to use and configure with minimal or no support.
  • be as lightweight as possible.
  • support advanced customization through the WordPress filter/action system (for developers and advanced users).

Free License and Donations

Add-Meta-Tags is released under the terms of the Apache License version 2 and, therefore, is Free software.

However, a significant amount of time and energy has been put into developing this plugin, so, its production has not been free from cost. If you find this plugin useful and if it has helped your blog get indexed better and rank higher, you can show your appreciation by making a small donation.

Donations in the following crypto currencies are also accepted and welcome. Send coins to the following addresses:

  • BitCoin (BTC): 1KkgpmaBKqQVk643VRhFRkL19Bbci4Mwn9
  • DarkCoin (DRK): Xdqg9LVu1pbZEBnNTBuewsnf4cjXU4yoai
  • LiteCoin (LTC): LS8UF39LfLahzGo49y736ooRYBVT1zZ2Fa
  • BlackCoin (BC): BCjPbumdgyDXKyVBc9GgyfaEL3q8942W1o

Thank you in advance for donating!

What it does

Add-Meta-Tags (AMT) adds metadata to your web site. This metadata contains information about the content, the author, the media files, which have been attached to your content, and even about some of the embedded media (see the details about this feature in the relevant section below).

Metadata refers to information that describes the content in a machine-friendly way. Search engines and other online services use this metadata to better understand your content. Keep in mind that metadata itself does not automatically make your blog rank better. For this to happen the content is still required to meet various quality standards. However, the presence of accurate and adequate metadata gives search engines and other services the chance to make less guesses about your content, index and categorize it better and, eventually, deliver it to an audience that finds it useful. Good metadata facilitates this process and thus plays a significant role in achieving better rankings. This is what the Add-Meta-Tags plugin does.

The following list outlines how and where metadata is added to a WordPress blog.

Basic meta tags

The description and keywords meta tags are added:

Front Page

  • Automatic addition of the blog's tagline in the description metatag.
  • Automatic addition of the blog's categories in the keywords metatag.
  • Customization is possible through the plugin's administration panel.
  • If a static page is used as the front page, customization is possible at the page's editing panel (Metadata box).

Posts & Pages

  • Automatic addition of an auto-generated excerpt of the post's or page's content in the description metatag. In case a post has a user-defined excerpt, then this is what is used.
  • Automatic addition of the post's categories and tags in the keywords meta tag. Pages do not support categories and tags, so there is no automatic addition of the keywords metatag.
  • Customization is possible by adding a custom description and keywords in the post's or page's editing panel (Metadata box).

Attachment Pages

  • A description metatag is automatically generated from the caption or, if a caption has not been set, from the description of the attachment.

Custom Post Types

  • A description is automatically generated from the first paragraph of the content. Keywords are not generated automatically.
  • Customization of the description and keywords meta tags is possible at the post type's editing panel (Metadata box).

Category-based Archives

  • The description of the category, if set, is used in the description meta tag. If a description does not exist, then a generic one is used.
  • The name of the category is always used in the keywords metatag.

Tag-based Archives

  • The description of the tag, if set, is used in the description meta tag. If a description does not exist, then a generic one is used.
  • The name of the tag is always used in the keywords metatag.

Author-based Archives

  • The bio of the WordPress user, if set, is used in the description meta tag on the first page of the author archive. All other author archive pages use a generic description.
  • The categories of the posts that are currently being displayed in the page are used in the keywords meta tag.

Extended Meta Tag Support

The following advanced features are also available:

Global keywords

  • It is possible to set some keywords that are prepended/appended to the keywords of all your content.

Site-wide META Tags

  • It is possible to force any metatags site-wide.

Custom title tag

It is possible to customize the title element on posts, pages and public custom post types.

'news_keywords' meta tag

It is possible to set a news_keywords meta tag for posts, pages and any public custom post type. For more info about the news_keywords metatag, please read this Google help page.

Per post full meta tags

It is possible to assign custom full meta tags to single posts (posts, pages, custom post types).

Copyright Metatag

It is possible to add a head link to a user-defined copyright page.

Default Image

A path to an image, for instance the we site's logo, can be set in order to be used in autogenerated metadata if a featured image has not been set for the content.

Opengraph metadata

Opengraph meta tags can be automatically added to the front page, posts, pages, attachment pages and author archive.

Schema.org Microdata

Schema.org Microdata can be automatically added to the front page, posts, pages, image attachment pages and author archive.

The plugin automatically marks up posts, pages and custom post types as Article objects and also images, videos and audio as Image, Video and Audio MediaObjects respectively. It also considers the web site as an Organization object and the author as a Person object.

Twitter Cards

Twitter Cards can be automatically added to content pages and image attachment pages.

Dublin Core metadata

Dublin Core metatags can be automatically added to posts and pages and attachment pages.

Other Features

Extra SEO features

  • Add the NOODP,NOYDIR option to the robots meta tag.
  • Add the NOINDEX,FOLLOW options to the robots meta tag on category, tag, author or time based archives and search results.

Metadata Review Mode

When enabled, WordPress users with administrator privileges see a box that contains the full metadata (exactly as it is added in the HTML head) above the content for easier examination.

Metadata for embedded media

Add-Meta-Tags generates detailed metadata for the media that have been attached to the content. This happens for all the media you manage in the WordPress media library.

Apart from attaching local media to the content, WordPress lets authors also embed external media by simply adding a link to those media inside the content or by using the [embed] shortcode. Several external services are supported.

Add-Meta-Tags can detect some of those media and generate metadata for them. Currently, only links to Youtube and Vimeo videos, Soundcloud tracks and Flickr images are supported. So, even if you host your media externally on those services, this plugin can still generate metadata for them. This metadata is by no means as detailed as the metadata that is generated for local media, but it gives search engines a good idea about what external media are associated with your content.

This feature relies entirely on the data WordPress has already cached for the embedded media. The plugin will never send any requests to external services attempting to get more detailed information about the embedded media as this would involve unacceptable overhead.

Here is what is supported:

This feature should be considered experimental. This information might be changed in future versions of the plugin.

Translations

There is an ongoing effort to translate Add-Meta-Tags to as many languages as possible. The easiest way to contribute translations is to register to the translations project at the Transifex service.

Once registered, join the team of the language translation you wish to contribute to. If a team does not exist for your language, be the first to create a translation team by requesting the language and start translating.

Code Contributions

If you are interested in contributing code to this project, please make sure you read the special section for this purpose, which contains all the details.

Support and Feedback

Please post your questions and provide general feedback and requests at the Add-Meta-Tags Community Support Forum.

To avoid duplicate effort, please do some research on the forum before asking a question, just in case the same or similar question has already been answered.

Also, make sure you read the FAQ.

Advanced Customization

Add-Meta-Tags allows filtering of the generated metatags and also of some core functionality through filters. This way advanced customization of the plugin is possible.

Add-Meta-Tags generates metadata that is used in the head area of the HTML page or embedded in the body (wrapped around the content or in the footer area).

The available filters are:

  1. amt_metadata_head - applied to all metatags that have been generated by Add-Meta-Tags for the head area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  2. amt_metadata_footer - applied to all metatags that have been generated by Add-Meta-Tags for the footer area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  3. amt_basic_metadata_head - applied to the basic metatags (description, keywords, etc) that have been generated by Add-Meta-Tags for the head area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  4. amt_opengraph_metadata_head - applied to the OpenGraph metatags that have been generated by Add-Meta-Tags for the head area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  5. amt_twitter_cards_metadata_head - applied to the Twitter Cards metatags that have been generated by Add-Meta-Tags for the head area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  6. amt_dublin_core_metadata_head - applied to the Dublin Core metatags that have been generated by Add-Meta-Tags for the head area of the HTML page. The hooked function should accept and return 1 argument: an array of meta tags.
  7. amt_dublin_core_license - applied to the URL of the license that is used by the Dublin Core metadata generator. The hooked function should accept and return 1 argument: a string. The hooked function can also accept the post ID as a second optional argument.
  8. amt_schemaorg_metadata_head - applied to the 'author' and 'publisher' links in the head area of HTML page that have been generated by Add-Meta-Tags for Google+. The hooked function should accept and return 1 argument: an array of links.
  9. amt_schemaorg_metadata_footer - applied to the Schema.org metatags that have been generated by Add-Meta-Tags for the footer area. The hooked function should accept and return 1 argument: an array of meta tags.
  10. amt_schemaorg_metadata_content - applied to the Schema.org Microdata that has been generated by Add-Meta-Tags and is embedded around the content. The hooked function should accept and return 1 argument: an array of microdata. Note that articleBody is added to the array after filtering.
  11. amt_get_the_excerpt - applied to the description that Add-Meta-Tags generates from the first paragraph of the content if no other description has been defined by the user. The hooked function should accept and return 1 argument: a string.
  12. amt_paged_append_data - applied to the data that should be appended when paginated content is encountered and a page number greater than 1 is displayed. The hooked function should accept and return 1 argument: a string.
  13. amt_supported_post_types - applied to the list of post types Add-Meta-Tags should add metadata to. By default, this list includes posts, pages, attachments and all available public post types. The hooked function should accept and return 1 argument: an array of post types.
  14. amt_external_description_fields - applied to the list of external custom fields from which Add-Meta-Tags can read data for the description metatag. The hooked function should accept and return 1 argument: an array of field names. The hooked function can also accept the post ID as a second optional argument. Keep in mind that Add-Meta-Tags always saves description data to its default field, regardless of the field the data was read from.
  15. amt_external_keywords_fields - applied to the list of external custom fields from which Add-Meta-Tags can read data for the keywords metatag. The hooked function should accept and return 1 argument: an array of field names. The hooked function can also accept the post ID as a second optional argument. Keep in mind that Add-Meta-Tags always saves keywords data to its default field, regardless of the field the data was read from.
  16. amt_external_title_fields - applied to the list of external custom fields from which Add-Meta-Tags can read data for the title metatag. The hooked function should accept and return 1 argument: an array of field names. The hooked function can also accept the post ID as a second optional argument. Keep in mind that Add-Meta-Tags always saves title data to its default field, regardless of the field the data was read from.
  17. amt_external_news_keywords_fields - applied to the list of external custom fields from which Add-Meta-Tags can read data for the news_keywords metatag. The hooked function should accept and return 1 argument: an array of field names. The hooked function can also accept the post ID as a second optional argument. Keep in mind that Add-Meta-Tags always saves news_keywords data to its default field, regardless of the field the data was read from.
  18. amt_external_full_metatags_fields - applied to the list of external custom fields from which Add-Meta-Tags can read full meta tag HTML code. The hooked function should accept and return 1 argument: an array of field names. The hooked function can also accept the post ID as a second optional argument. Keep in mind that Add-Meta-Tags always saves full meta tag data to its default field, regardless of the field the data was read from.
  19. amt_embedded_media - applied to the array in which Add-Meta-Tags stores information about the embedded media. The hooked function should accept and return 1 argument: an array of post types. The hooked function can also accept the post ID as a second optional argument.
  20. amt_valid_full_metatag_html - applied to all list of valid HTML elements and attributes that can be used in the 'Full Meta Tags' boxes in the general settings and in the metabox. The hooked function should accept and return 1 argument: an array of valid elements and their attributes. The provided array has the same format as the $allowed_html array of the wp_kses function.

Example 1: you want to replace the autogenerated og:site_name Opengraph metatag with a custom one.

This can easily be done by hooking a custom function to the amt_opengraph_metadata_head filter:

function customize_og_sitename_metatag( $metatags ) {
    // ... replace 'og:site_name' here
    return $metatags;
}
add_filter( 'amt_opengraph_metadata_head', 'customize_og_sitename_metatag', 10, 1 );

This code can be placed inside your theme's functions.php file.

Example 2: you want to limit the generation of metadata by Add-Meta-Tags to specific post types.

This can easily be done by hooking a custom function to the amt_supported_post_types filter:

function limit_metadata_to_post_types( $post_types ) {
    // ... process and return the $post_types array
    // ... or just return a custom array of post types
    return array( 'post', 'book', 'project');
}
add_filter( 'amt_supported_post_types', 'limit_metadata_to_post_types', 10, 1 );

This code can be placed inside your theme's functions.php file.

Example 3: you use plugin X that saves the descriptions, keywords, etc in its custom fields. You want to migrate to Add-Meta-Tags and need to read the fields of your old plugin.

This can easily be done by hooking custom functions to the amt_external_description_fields and amt_external_keywords_fields filters:

function read_old_plugin_description_field( $extfields ) {
    // Although $extfields is currently empty, it's a good practice to
    // append your old plugins description field to the $extfields array.
    array_unshift( $extfields, 'my_old_plugin_description_field' );
    return $extfields;
}
add_filter( 'amt_external_description_fields', 'read_old_plugin_description_field', 10, 1 );

function read_old_plugin_keywords_field( $extfields, $post_id ) {
    // This function also demonstrates how to get and possibly use the post's ID
    // Append your old plugins keywords field to the $extfields array
    if ( in_array( $post_id, array( 1, 2, 5, 8 ) ) ) {
        array_unshift( $extfields, 'my_old_plugin_keywords_field' );
    }
    return $extfields;
}
add_filter( 'amt_external_keywords_fields', 'read_old_plugin_keywords_field', 10, 2 );

This code can be placed inside your theme's functions.php file.

Keep in mind that:

  1. AMT internal fields have priority over the external fields. If both the internal field and an external field contain data, then the data of the internal field is used.
  2. AMT uses external fields to only read data. It never writes to external fields. Whenever the content is saved, every piece of information, which may have been read from an external field, is stored to the relevant AMT internal field. Consequently, when the content is saved, information from external fields is migrated to the AMT internal fields, and external fields have no effect on this specific content any more.

Example 4: Add the title element to the valid html elements for use in the full meta tags box.

This can easily be done by hooking custom functions to the amt_valid_full_metatag_html filter:

function extend_full_metatag_valid_elements( $valid_elements ) {
    // Construct the title element array (key: element name, value: array of valid attributes)
    $title_element = array( 'title' => array() );
    // Append the 'title' element to the valid elements
    $valid_elements = array_merge( $valid_elements, $title_element );
    return $valid_elements;
}
add_filter( 'amt_valid_full_metatag_html', 'extend_full_metatag_valid_elements', 10, 1 );

Custom Fields

Add-Meta-Tags uses the following internal custom fields to store data related to the content:

  • _amt_description - the content's custom description (the description field is also read as a fallback for backwards compatibility).
  • _amt_keywords - the content's custom keywords (the keywords field is also read as a fallback for backwards compatibility).
  • _amt_title - the content's custom title.
  • _amt_news_keywords - the content's custom news keywords.
  • _amt_full_metatags - the content's full meta tag code.

The following internal custom fields are also used to store user contact info, which is required for full Add-Meta-Tags functionality:

TODO: add contactinfo fields here

Template Tags

The following template tags are available for use in your theme:

  1. amt_content_description() : prints the content's description as generated by Add-Meta-Tags.
  2. amt_content_keywords() : prints a comma-delimited list of the content's keywords as generated by Add-Meta-Tags.
  3. amt_metadata_head() : prints the full metadata for the head area as generated by Add-Meta-Tags.
  4. amt_metadata_footer() : prints the full metadata for the head area as generated by Add-Meta-Tags.

Theme Requirements

Add-Meta-Tags uses the wp_head and wp_footer action hooks to embed metadata to the HTML HEAD and the HTML BODY. Therefore, it is essential that your theme includes these two action hooks in its templates.

More

Check out other open source software by George Notaras.

Requires: 3.1.0 or higher
Compatible up to: 3.9.1
Last Updated: 2014-7-16
Downloads: 312,671

Ratings

4 stars
4.7 out of 5 stars

Support

3 of 10 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

4 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,2,2
50,2,1
100,1,1
33,3,1
100,1,1
100,2,2
50,2,1
100,2,2
100,2,2
100,1,1 100,3,3
100,2,2
100,3,3
100,2,2 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,6,6
100,2,2 0,1,0
100,2,2 67,3,2 100,1,1 100,1,1 100,2,2
100,2,2 67,3,2
100,3,3 100,1,1 100,2,2 50,2,1
100,4,4
100,1,1 100,3,3 100,2,2
100,2,2
100,4,4