SPIP

[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [sv] [tr] [vi] [zh] Espace de traduction

Download
Home page > English documentation > Webmasters > A few examples of loops > Filling HTML Meta tags on article pages

Filling HTML Meta tags on article pages

November 2003 — updated : March 2009

All the versions of this article:

The goal of this example is to populate the meta tags on our page with the list of keywords associated with the article as well as the names of the authors.


If you want to optimize the indexing of your site by search engines, you can, for example, include the description of the article, the associated keywords and the name of the authors in special tags, called "meta tages" and located in the HTML document’s header.

Meta tages examples filled by SPIP
Action HTML/SPIP syntax
Page title <title>[(#NOM_SITE_SPIP|textebrut)]</title>
Description [<meta name="Description" content="(#INTRODUCTION|couper{200}|textebrut)" />]
Keywords
<B_keywords>
<meta name="Keywords" content="<BOUCLE_keywords(MOTS) {id_article} {","}>[(#TITRE|textebrut)]</BOUCLE_keywords>" />
</B_keywords>

Authors [<meta name="Author" content="(#LESAUTEURS|textebrut)" />]
Application name <meta name="Generator" content="SPIP[ (#SPIP_VERSION)]" />
Webmaster’s e-mail [<meta name="Reply-to" content="(#EMAIL_WEBMASTER|textebrut)" />]

Do not forget to apply the filter textebrut on the SPIP tags to remove the tags, paragraphs and spaces that don’t belong here. Also, stay within the limits of the number of characters requires by each meta tag, using the filter couper.

These meta tags are not essential to the indexing of the site. However, do not forget the page title, which is still important especially because it identifies each page of your site in the search engine results.

Here is the full example for the article template (to be placed in a ARTICLES loop within the head tags of the page

You can adapt this example to other kinds of elements such as sections, news items, etc.


ٍShow the template of this page Site created with SPIP | Translation area | Private area