Magento Tutorials

Adding custom code in Magento 2 HTML tag

Hello Magento Friends,

Today’s Tutorial Blog for Magento 2 will justify, Adding custom code in Magento 2 <head> HTML tag.

Head tag is used to link any external resources, add metadata or javascript code to your website. In Magento 2 you can configure the <head> tag for each store view. Instructions for search engine and store demo notice are added in the head section. Any javascript code which is to be added before the <body> tag must be included here.

Let’s learn Adding custom code in Magento 2 <head> HTML tag.

Steps to Add custom code in Magento 2 <head> HTML tag:

Step 1: Go to the Magento Admin Panel and navigate to Content > Design > Configuration.

Step 2: Select the store view to change the head tag or select global to change the head tag for every store view.

Step 3: Enlarge the HTML Head section. Add your custom code to the Scripts and Style Sheets field.

Step 4: At last, Save Configuration. Go to Cache Management and Flush Magento Cache.

Final Words:

Hence, this way you can add custom code in Magento 2 <head> HTML tag. Catch up with our certified Magento Developers to customize your store. In case of any casualties, do let me know via the comment section. Share the tutorial with your friends and stay connected!

Happy Reading!

Click to rate this post!
[Total: 4 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

Recent Posts

Magento 2: Add Quantity Increment and Decrement on Category Page

Hello Magento Friends, In this blog, we will discuss about adding quantity increment and decrement…

2 days ago

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

5 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

7 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

7 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

1 week ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

1 week ago