README.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. Metatag
  2. -------
  3. This module allows you to automatically provide structured metadata, aka "meta
  4. tags", about your website and web pages.
  5. In the context of search engine optimization, providing an extensive set of
  6. meta tags may help improve your site's & pages' ranking, thus may aid with
  7. achieving a more prominent display of your content within search engine
  8. results. Additionally, using meta tags can help control the summary content
  9. that is used within social networks when visitors link to your site,
  10. particularly the Open Graph submodule for use with Facebook, Pinterest,
  11. LinkedIn, etc (see below).
  12. This version of the module only works with Drupal 7.28 and newer.
  13. For additional information, see the online documentation:
  14. https://www.drupal.org/docs/7/modules/metatag
  15. Features
  16. --------------------------------------------------------------------------------
  17. The primary features include:
  18. * The current supported basic meta tags are ABSTRACT, DESCRIPTION, CANONICAL,
  19. GENERATOR, GEO.PLACENAME, GEO.POSITION, GEO.REGION, ICBM IMAGE_SRC, KEYWORDS,
  20. PUBLISHER, REFRESH, REVISIT-AFTER, RIGHTS, ROBOTS, SHORTLINK, and the page's
  21. TITLE tag.
  22. * Multi-lingual support using the Entity Translation module.
  23. * Translation support using the Internationalization (i18n) module of the global
  24. configurations, the values for all three submodules (Metatag:Context,
  25. Metatag:Panels, Metatag:Views), and the final meta tags being output.
  26. * Full support for entity revisions and workflows based upon revision editing,
  27. including compatibility with the Revisioning and Workbench Moderation modules.
  28. * Automatically extracts URLs from image fields, no need for extra modules.
  29. * A custom pager string may be added to meta tags by inserting the token
  30. [current-page:pager] into e.g. page titles, description tags, etc. The
  31. replacement string may be customized from the settings page.
  32. * Per-path control over meta tags using the "Metatag: Context" submodule
  33. (requires the Context module).
  34. * Integration with the Views module allowing meta tags to be controlled for
  35. individual Views pages, with each display in the view able to have different
  36. meta tags, by using the "Metatag: Views" submodule.
  37. * Integration with the Panels module allowing meta tags to be controlled for
  38. individual Panels pages, by using the "Metatag: Panels" submodule.
  39. * The fifteen Dublin Core Basic Element Set 1.1 meta tags may be added by
  40. enabling the "Metatag: Dublin Core" submodule.
  41. * Forty additional Dublin Core meta tags may be added by enabling the "Metatag:
  42. Dublin Core Advanced" submodule.
  43. * The Open Graph Protocol meta tags, as used by Facebook, Pinterest, LinkedIn
  44. and other sites, may be added by enabling the "Metatag: Open Graph" submodule.
  45. * Twenty six additional Open Graph Protocol meta tags are provided for
  46. describing products in the "Metatag: Open Graph Products" submodule.
  47. * The Twitter Cards meta tags may be added by enabling the "Metatag: Twitter
  48. Cards" submodule.
  49. * Certain meta tags used by Google+ may be added by enabling the "Metatag:
  50. Google+" submodule.
  51. * Facebook's fb:app_id, fb:admins and fb:pages meta tags may be added by
  52. enabling the "Metatag: Facebook" submodule. These are useful for sites which
  53. are using Facebook widgets or are building custom integration with Facebook's
  54. APIs, but they are not needed by most sites and have no bearing on the
  55. Open Graph meta tags.
  56. * The App Links meta tags may be added by enabling the Metatag: App Links
  57. submodule.
  58. * Site verification meta tags can be added, e.g. as used by the Google search
  59. engine to confirm ownership of the site; see the "Metatag: Verification"
  60. submodule.
  61. * The Metatag: Mobile & UI Adjustments submodule adds the MobileOptimized,
  62. HandheldFriendly, viewport, cleartype, theme-color, format-detection,
  63. apple-mobile-web-app-capable, apple-mobile-web-app-status-bar-style, the
  64. android-app and ios-app alternative link meta tags, and the Android manifest
  65. tag.
  66. * The hreflang meta tags are available via the Metatag:hreflang submodule.
  67. * Support for meta tags specific to Google Custom Search Appliance are available
  68. in the "Metatag: Google Custom Search Engine (CSE)" submodule.
  69. * A variety of favicon sizes and styles can be added to the global configuration
  70. using the Metatag: Favicons submodule.
  71. * An API allowing for additional meta tags to be added, beyond what is provided
  72. by this module - see metatag.api.php for full details.
  73. * Support for the Migrate module for migrating data from another system - see
  74. metatag.migrate.inc for full details.
  75. * Support for the Feeds module for importing data from external data sources or
  76. file uploads.
  77. * Support for the Search API module for indexing of keywords.
  78. * Integrates with Devel_Generate, part of the Devel module, to automatically
  79. generate meta tags for generated nodes, via the Metatag:Devel submodule.
  80. * Integrates with Workbench Moderation (v1) allowing meta tags on nodes to be
  81. managed through the workflow process; this custom support is not needed in
  82. Workbench Moderation v3 so the extra logic is automatically ignored.
  83. * The Transliteration module (see below) is highly recommended when using image
  84. meta tags, e.g. og:image, to ensure that filenames are HTML-safe.
  85. * Adds an extra item to the "Flush all caches" menu for the Admin Menu module,
  86. allowing for a quick way to clear the Metatag module's custom caches.
  87. * A custom pane, called "Node form meta tags", is available for adding the meta
  88. tags fieldset when the node_edit page is customized using Panels; the
  89. Metatag: Panels submodule does not need to be enabled in order for this to
  90. work.
  91. * Several advanced options may be controlled via the Settings page.
  92. * An import script is provided in the Metatag:Importer submodule for D6 sites
  93. that used Nodewords and need to migrate the data.
  94. * If the Media module (v2) is installed, the Media WYSIWYG submodule will be
  95. used to automatically filter out Media's embed codes.
  96. Configuration
  97. --------------------------------------------------------------------------------
  98. 1. On the People Permissions administration page ("Administer >> People
  99. >> Permissions") you need to assign:
  100. - The "Administer meta tags" permission to the roles that are allowed to
  101. access the meta tags admin pages to control the site defaults.
  102. - The "Edit meta tags" permission to the roles that are allowed to change
  103. meta tags on each individual page (node, term, etc).
  104. 2. The main administrative page controls the site-wide defaults, both global
  105. settings and defaults per entity (node, term, etc), in addition to those
  106. assigned specifically for the front page:
  107. admin/config/search/metatags
  108. 3. The list of supported entity types (nodes, taxonomy terms, etc) and bundles
  109. (content types, vocabularies, etc) may be controlled from the Settings page:
  110. admin/config/search/metatags/settings
  111. 4. In order to provide a specific configuration per entity bundle (content
  112. type, vocabulary, etc), click "Add default meta tags".
  113. 5. Each supported entity object (nodes, terms, users) will have a set of meta
  114. tag fields available for customization on their respective edit page, these
  115. will inherit their values from the defaults assigned in #2 above. Any
  116. values that are not overridden per object will automatically update should
  117. the defaults be updated.
  118. 6. As the meta tags are output using Tokens, it may be necessary to customize
  119. the token display for the site's entities (content types, vocabularies,
  120. etc). To do this go to e.g., admin/structure/types/manage/article/display,
  121. in the "Custom Display Settings" section ensure that "Tokens" is checked
  122. (save the form if necessary), then to customize the tokens go to:
  123. admin/structure/types/manage/article/display/token
  124. Internationalization with the Translation (core) and Entity Translation modules
  125. --------------------------------------------------------------------------------
  126. The module works with the core Translation module, allowing the meta tags for a
  127. specific entity (node, term, etc) to be tied to a specific language. It also
  128. supports the Entity Translation module, which may work better thank the basic
  129. Translation module depending upon the site's desired functionality. This
  130. integration means that content creators can customize an entity's meta tags for
  131. each language supported on the site, and that the correct meta tags should
  132. always be displayed for each locale.
  133. Internationalization with the i18n modules
  134. --------------------------------------------------------------------------------
  135. Using the String Translation (i18n_string) submodule of the Internationalization
  136. (i18n) module package it is possible to translate meta tags:
  137. * All default configurations (admin/config/search/metatag) are translatable.
  138. When a configuration is created or updated it will pass the values to the
  139. i18n_string system. Additionally it is possible to bulk update them via the
  140. string translation page (admin/config/regional/translate/i18n_string).
  141. * Meta tags for all submodules (Metatag:Context, Metatag:Panels, Metatag:Views)
  142. are translatable. Similar to the default configurations, these meta tags are
  143. made available when they are created and/or update, and may also be bulk
  144. updated.
  145. * Meta tags from entities (nodes, terms, etc) are not directly translatable.
  146. * The final output meta tags are passed through the translation system when the
  147. page is being loaded. It is not possible to use the strings bulk updater to
  148. spool all pages on the site, to do so it would be necessary to spool the page
  149. using a separate script or tool.
  150. Additionally, certain variables are available for translation using the Variable
  151. Translation submodule of the i18n package:
  152. * metatag_pager_string - The custom pager string.
  153. Internationalization with the Smartling module
  154. --------------------------------------------------------------------------------
  155. The Smartling translation service may be used with the Metatag module provide an
  156. improved UX around the meta tag translation process. In order to do this, the
  157. Smartling Interface Translation (smartling_interface_translation) module must
  158. be enabled.
  159. For further details see the module's project page:
  160. https://www.drupal.org/project/smartling
  161. Search API integration
  162. --------------------------------------------------------------------------------
  163. Entity meta tag values can be made searchable using the Search API module
  164. (https://www.drupal.org/project/search_api).
  165. 1. Select "Meta tags" under "Data alterations" in the filters for the
  166. index:
  167. admin/config/search/search_api/index/INDEX NAME/workflow
  168. 2. Meta tag fields will now appear under "Fields" and can be enabled there:
  169. admin/config/search/search_api/index/INDEX NAME/fields
  170. Fine tuning & suggestions
  171. --------------------------------------------------------------------------------
  172. * There are many options available on the settings page to control how Metatag
  173. works:
  174. admin/config/search/metatags/settings
  175. * It is possible to "disable" the meta tags provided by Drupal core, i.e.
  176. "generator", "canonical URL" and "shortlink", though it may not be completely
  177. obvious. Metatag takes over the display of these tags, thus any changes made
  178. to them in Metatag will supercede Drupal's normal output. To hide a tag, all
  179. that is necessary is to clear the default value for that tag, e.g. on the
  180. global settings for nodes, which will result in the tag not being output for
  181. those pages.
  182. * When using Features to export Metatag configurations, it is suggested to
  183. override all of the default configurations and then disable the default
  184. configurations via the advanced settings page; doing so will avoid potential
  185. conflicts of the same configurations being loaded by both the Metatag module
  186. and the new Features-based modules.
  187. * Using fields to automatically fill in values for image meta tags is the
  188. recommended way of inserting images - the module will automatically extract
  189. the URL from the value. However, by default this forces social networks,
  190. search engines and certain browsers to download the original version of the
  191. image, which could be multiple megabytes. The alternative is to use the
  192. Imagecache_Token module to instead load meta tags via a specific image style.
  193. As an example, in order to load an image from a node field named
  194. "field_meta_tag_image" using the "seo_thumbnail" style, the following token
  195. would be used:
  196. [node:field_meta_tag_image:seo_thumbnail:uri]
  197. or
  198. [node:field_meta_tag_image:seo_thumbnail]
  199. (They give the same results)
  200. Additionally, dimensions of the image may be obtained from the following:
  201. [node:field_meta_tag_image:seo_thumbnail:width]
  202. [node:field_meta_tag_image:seo_thumbnail:height]
  203. Developers
  204. --------------------------------------------------------------------------------
  205. Full API documentation is available in metatag.api.php.
  206. It is not necessary to control Metatag via the entity API, any entity that has
  207. view modes defined and is not a configuration entity is automatically suitable
  208. for use.
  209. The meta tags for a given entity object (node, etc) can be obtained as follows:
  210. $metatags = metatags_get_entity_metatags($entity_id, $entity_type, $langcode);
  211. The result will be a nested array of meta tag structures ready for either output
  212. via drupal_render(), or examining to identify the actual text values.
  213. Troubleshooting / known issues
  214. --------------------------------------------------------------------------------
  215. * When using custom page template files, e.g., page--front.tpl.php, it is
  216. important to ensure that the following code is present in the template file:
  217. <?php render($page['content']); ?>
  218. or
  219. <?php render($page['content']['metatags']); ?>
  220. Without one of these being present the meta tags will not be displayed.
  221. * An alternative method to fixing the missing-tags problem is to change the page
  222. region used to output the meta tags. The region used may be controlled from
  223. the settings page, it is recommended to test different options to identify the
  224. one that works best for a specific site.
  225. * Versions of Drupal older than v7.17 were missing necessary functionality for
  226. taxonomy term pages to work correctly.
  227. * Using Metatag with values assigned for the page title and the Page Title
  228. module simultaneously can cause conflicts and unexpected results. It is
  229. strongly recommended to convert the Page Title settings to Metatag and just
  230. uninstall Page Title entirely. See https://www.drupal.org/node/2774833 for
  231. further details.
  232. * When customizing the meta tags for user pages, it is strongly recommended to
  233. not use the [current-user] tokens, these pertain to the person *viewing* the
  234. page and not e.g., the person who authored a page.
  235. * Certain browser plugins, e.g., on Chrome, can cause the page title to be
  236. displayed with additional double quotes, e.g., instead of:
  237. <title>The page title | My cool site</title>
  238. it will show:
  239. <title>"The page title | My cool site"</title>
  240. The solution is to remove the browser plugin - the page's actual output is not
  241. affected, it is just a problem in the browser.
  242. * Drupal core versions before v7.33 had a bug which caused validation problems
  243. in the Open Graph output if the RDF module was also enabled. The solution is
  244. to update to core v7.33 or newer.
  245. * If the Administration Language (admin_language) module is installed, it is
  246. recommended to disable the "Force language neutral aliases" setting on the
  247. Admin Language settings page, i.e. set the "admin_language_force_neutral"
  248. variable to FALSE. Failing to do so can lead to data loss in Metatag.
  249. * If Entity Token is installed (a dependency for Rules, Commerce and others) it
  250. is possible that the token browser may not work correctly and may either
  251. timeout or give an error instead of a browsable list of tokens. This is a
  252. limitation of the token browser.
  253. Related modules
  254. --------------------------------------------------------------------------------
  255. Some modules are available that extend Metatag with additional or complimentary
  256. functionality:
  257. * Transliteration
  258. https://drupal.org/project/transliteration
  259. Tidies up filenames for uploaded files, e.g. it can remove commas from
  260. filenames that could otherwise break certain meta tags.
  261. * Imagecache Token
  262. https://www.drupal.org/project/imagecache_token
  263. Use tokens to load images via image styles, rather than forcing meta tags to
  264. use the original image.
  265. * Alternative hreflang
  266. https://www.drupal.org/project/hreflang
  267. An alternative to the Metatag:hreflang module. Automatically outputs
  268. <link rel="alternate" hreflang="x" href="http://" /> meta tags on every page
  269. for each language/locale available on the site. Also does not provide any way
  270. of overriding the values or setting the x-default value.
  271. * Domain Meta Tags
  272. https://drupal.org/project/domain_meta
  273. Integrates with the Domain Access module, so each site of a multi-domain
  274. install can separately control their meta tags.
  275. * Select or Other
  276. https://drupal.org/project/select_or_other
  277. Enhances the user experience of the metatag_google_plus and metatag_opengraph
  278. submodules by allowing the creation of custom itemtype and og:types values.
  279. * Node Form Panes
  280. https://drupal.org/project/node_form_panes
  281. Create custom node-edit forms and control the location of the Metatag fields.
  282. * Textimage
  283. https://drupal.org/project/textimage
  284. Supports using Textimage's custom tokens in meta tag fields.
  285. * Field Multiple Limit
  286. https://drupal.org/project/field_multiple_limit
  287. Allows control over how many items are output in a multi-item field, useful
  288. with meta tags that only allow for one item but which are assigned from fields
  289. which accept multiple items, e.g. og:audio and og:video.
  290. * Real-time SEO for Drupal
  291. https://www.drupal.org/project/yoast_seo
  292. Uses the YoastSEO.js library and service (https://yoast.com/) to provide
  293. realtime feedback on the meta tags.
  294. * Parse.ly Publishing Analytics
  295. https://www.drupal.org/project/parsely
  296. Automatically generates meta tags for the Parse.ly service.
  297. Credits / contact
  298. --------------------------------------------------------------------------------
  299. Currently maintained by Damien McKenna [1] and Dave Reid [2]; all initial
  300. development was by Dave Reid.
  301. Ongoing development is sponsored by Mediacurrent [3] and Lullabot [4]. All
  302. initial development was sponsored by Acquia [5] and Palantir.net [6].
  303. The best way to contact the authors is to submit an issue, be it a support
  304. request, a feature request or a bug report, in the project issue queue:
  305. https://www.drupal.org/project/issues/metatag
  306. References
  307. --------------------------------------------------------------------------------
  308. 1: https://www.drupal.org/u/damienmckenna
  309. 2: https://www.drupal.org/u/dave-reid
  310. 3: https://www.mediacurrent.com/
  311. 4: https://www.lullabot.com/
  312. 5: https://www.acquia.com/
  313. 6: https://www.palantir.net/