Announcement

Collapse
No announcement yet.

Meta Tag Getting Truncated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Meta Tag Getting Truncated

    I just discovered this today:

    Description: When my meta description includes a quote ', the text gets truncated at the quote. The preview shows text only up to the quote and the page generated has the same truncation.

    <META NAME='DESCRIPTION' CONTENT='Idle mixture screw, 1"' overall length, US manufactured, ethanol ready. Shipped fast, backed by our excellent customer support. Many idle mixture screws available through the online catalog. '>

    Preview and what gets generated:
    Idle mixture screw, 1

  • #2
    Yeah, that's not a 3dcart thing but maybe they should fix their previews to give people a warning. You can't use a quotation marks in meta tag text. Your second quote is closing the text portion of the tag. It actually should look more like this. I'm not sure how you ended up with single quotes there.

    <META NAME="DESCRIPTION" CONTENT="Idle mixture screw, 1 inch overall length, US manufactured, ethanol ready. Shipped fast, backed by our excellent customer support. Many idle mixture screws available through the online catalog">

    Comment


    • #3
      Most other shopping carts normally have a specific field like meta description that will automatically encode the characters. 3dcart however spits out whatever raw data you enter in the meta field. I would think that the meta wizard 3dcart provides should do this for you if you manually enter data but even that doesn't do it so that function is rather useless in my opinion.

      There is no reason why you cannot use a double quote character in the meta tag you just need to use the character entity for it.
      • "&quot; represents the " mark.
      https://www.w3.org/TR/html401/charset.html#entities

      Now I just noticed a serious flaw is 3dcart admin section for the meta field that should be addressed and I will be taking it up with support.

      If you do enter in a &quot; character in the meta field and click save it will save it fine and display fine on the page for the meta field but you will not be able to change any of the fields on the SEO product tab as it will revert back to displaying the un-encoded entity character in the admin field. So the next time you make a change all previously changes will be lost. Kinda stupid if you ask me. I mean if I enter a &quot; in the meta tag field it should definitely not revert back to a " character.

      BTW: If they decide not to fix this which they should I will probably have to create a script that runs on the admin page that encodes all quotes so it doesn't revert back so if I want or need to make any quick changes to a field in the SEO tab I can.
      Last edited by msk_nyc; 10-10-2020, 04:08 AM.

      Comment


      • #4
        To each their own. I've always skipped double quotes in the meta tag but maybe they're important to your business.FYI, you also need to be careful about using quotes in the title tag field.

        Comment


        • #5
          The answer is the same for the title tag, use &quot;.

          You are making the assumption that " always = inch and it does not. Bulk replacing all " in your dataset to inch or inches would not be correct and doing this on an individual basis would be a logistical nightmare. Best to keep it in its original intended meaning.

          Comment


          • #6
            Wow, I can't believe I didn't know this after all these years of doing this.
            Thanks for the info

            Comment

            Working...
            X