function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShawnFShawnF 

META tag attributes displayed in wrong order

I am concerned about the way the META tags are displayed on our Force.com Site.

 

For example, do a View > Source on this particular page.

 

You will see the 'description' and 'keywords' META tags are present. However, the order in which the tag is written concerns me.

 

The tag in my vf page source code is written like this:

 

<meta name="description" content="...">

 

But when you View > Source on the page linked above, you will see that the meta tag is written in reverse, like this:

 

<meta content="..." name="description">

 

where the 'content' and 'name' attributes of my META tag are reversed from the way I have them written in my vf page source code.

 

You will see the same thing happens for the 'keywords' META tag.

 

Questions:

 

  1. Does anyone know why the attributes are written in reverse order?
  2. Is there any risk to them being in reverse order?
  3. Can I somehow correct this? If so, can you please explain how to do so?
bob_buzzardbob_buzzard

HTML element attributes are unordered, meaning that the order is irrelevant, so there won't be any adverse effects to this.  I don't know why VF does this (and it can do more if you are using composition templates - it will remove meta elements that are empty), but I'd imagine the the page is stored in some kind of XML structure which returns the attributes in a non-deterministic fashion.

Bhawna SFDCBhawna SFDC
Hi Shawn,

I am also facing the same issue. Do we have any workaround of this ?

Thanks,
Bhawna