@stephon
Adding custom meta tags in Magento can help improve SEO and provide additional information about your pages. Here are steps for both Magento 1 and Magento 2:
Magento 1:
- Via Admin Panel for Specific Pages:
Log in to your Magento Admin Panel.
Go to Catalog > Manage Products if you want to set meta tags for a specific product, or Catalog > Manage Categories for categories.
Choose the specific product or category you want to edit.
Click on the Meta Information tab.
Enter your meta title, meta description, and meta keywords. For custom meta tags, you may need to modify the template files or use a module.
Save the changes.
- Programmically or Using a Custom Module:
You can override templates or use a custom module to add additional meta tags by editing the layout XML files or PHP scripts.
You can add a custom XML layout update in the local.xml or other appropriate layout XML files such as catalog.xml, depending on the page types you want to target.
Example for local.xml:
Magento 2:
- Via Admin Panel for Specific Pages:
Log in to your Magento 2 Admin Panel.
Go to Catalog > Products for products or Catalog > Categories for categories.
Edit the specific product or category.
Under the Search Engine Optimization section, you can add your meta title, meta keywords, and meta description.
For CMS pages, navigate to Content > Pages, select a page, and use the Meta Data section to add your meta tags.
Save the changes.
- Custom Module or Layout XML:
For more control and adding non-standard meta tags, you might have to create a custom module or edit your theme's layout XML files.
Example for default.xml:
Place this XML snippet within the relevant layout file, such as default.xml, to apply globally or to specific pages like catalog_product_view.xml or cms_page_view.xml.
- Using Theme Files:
You can directly modify the head block in your theme's default_head_blocks.xml or equivalent for your theme.
In your theme's folder, navigate to app/design/frontend/Vendor/theme/Magento_Theme/layout/default_head_blocks.xml and add your custom meta tags.
Note: Always back up your files and test changes in a development environment before applying them to the live site. Also, check for the latest practices and Magento documentation as Magento frequently updates its system.