README.txt 19 KB

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