CMS Development

LaurenRyan
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Two Viewport Tags on HubSpot CMS pages

SOLVE

Hey there! I've recently started receiving this error message in the Optimize section of all of my HubSpot CMS blog, website, & landing pages. After some digging, it looks like my pages have a duplicate of the HTML header tag. Any idea how to fix this?

 

Thank you!!

LaurenKennedy_0-1630244790947.png

LaurenKennedy_1-1630244866393.png

Website: https://www.coastalconsulting.co/

 

1 Accepted solution
LaurenRyan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Two Viewport Tags on HubSpot CMS pages

SOLVE

Okay - I fixed this one! So, the macros.html file wasn't in the correct path for the theme, so it was pulling in another theme that duplicated the <head> tag. Luckily HubSpot CMS flags errors for you if you take the team to read them. 😉 Getting more coffee now!

View solution in original post

4 Replies 4
LaurenRyan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Two Viewport Tags on HubSpot CMS pages

SOLVE

Okay - I fixed this one! So, the macros.html file wasn't in the correct path for the theme, so it was pulling in another theme that duplicated the <head> tag. Luckily HubSpot CMS flags errors for you if you take the team to read them. 😉 Getting more coffee now!

NRubright
Participant

Two Viewport Tags on HubSpot CMS pages

SOLVE

Hi Lauren,

Thanks for opening this thread. I'm in the same situation, with duplicate viewport meta tags.

Can you please provide more details about the fix? Feel free to provide all the details that come to your mind.
I'm interested in what path the macros.html should be placed in.

TPlatica
Participant

Two Viewport Tags on HubSpot CMS pages

SOLVE

I just found out that my second viewport meta tag was coming from the theme's JS code:

 

$("head").append('<meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=0">')

 

 

sharonlicari
Community Manager
Community Manager

Two Viewport Tags on HubSpot CMS pages

SOLVE

Thank you for sharing @LaurenRyan 🙂


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes