Search
Clear search
Close search
Google apps
Main menu
true

Change the order of meta tags in search results

Summary: You want to change the order of meta tags shown in search results for the default front end.


Fix: For example, you have the following 3 metadata in search results:

  • BLOCKNAME
  • DESCRIPTION
  • TEXT

You would like to see them aligned in a particular order, for example:

  • DESCRIPTION
  • BLOCKNAME
  • TEXT

In that case, you need to edit the XSLT code of your front end and replace the following block:

<!-- *** Meta tags *** --> 
<xsl:if test="$show_meta_tags != '0'"> 
<xsl:apply-templates select="MT"/> 
</xsl:if> 

with

<!-- *** Meta tags *** --> 
<xsl:if test="$show_meta_tags != '0'"> 
<xsl:apply-templates select="MT[@N='DESCRIPTION']"/> 
<xsl:apply-templates select="MT[@N='BLOCKNAME']"/> 
<xsl:apply-templates select="MT[@N!='DESCRIPTION' and @N!='BLOCKNAME']"/> 
</xsl:if> 

This change will render the DESCRIPTION metadata first, the BLOCKNAME metadata second and the other meta tags will be rendered in their regular order afterwards.


Additional Information: For more information on metadata:

Was this article helpful?
How can we improve it?