Jump to content

Adding Blog Category As Meta Data

Recommended Posts

I'm trying to use Ezoic for my ads, and one of the obstacles I'm running into is adding categories to my blog posts. I have them set up in Squarespace, but Ezoic is looking for them as meta data. Specifically, they are looking for the data is this format:

<meta name="category" content="Food">

I would prefer not to manually add this line to every page, so I was wondering if it is possible (and how) to use a JS script to generate this meta data based on the Squarespace category. To add a little more complexity, I use multiple categories, but only one is relevant for this, so I'd also like to be able to add a conditional statement to return only the correct category.

I would appreciate it if someone could point me in the right direction.

Link to comment
  • Replies 5
  • Views 349
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

36 minutes ago, SaturdaysInRome said:

<meta name="category" content="Food">

Have you added this to the header code injection for the blog posts?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment

In the blog settings, go to Advanced and Post Blog Item Code Injection, then paste that meta tag and it will be on every blog page.

image.thumb.png.af25b252d9ea9fda888484a2089381de.png

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment

Thanks Ziggy. I appreciate your response, but the challenge I may have poorly articulated is that there are 5 different categories (as of today), so I was hoping for a way to script the insert of the meta data in the header based on the differing category of the post. I defined the category within squarespace, but it doesn't generate metadata automatically. Again, I can believe it isn't possible, but if there is something I should look into further, that would be helpful.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.