Skip to main content
12 votes
Accepted

Magento 2: How to set meta tag in controller?

namespace Custom\Module\Controller\Index; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\...
Jackson's user avatar
  • 9,939
5 votes
Accepted

Magento 2 - Add meta detail on frontend page using Block

To Get exact idea how to set page meta data via block refer vendor/magento/module-cms/Block/Page.php In this magento have a function protected function _prepareLayout() { // ... $this->...
Kanhaiya lal's user avatar
  • 1,548
5 votes
Accepted

Add Custom Meta tag

If you want to add custom meta tag only on product page : Create: app/design/frontend/{Package}/{theme}/Magento_Catalog/layout/catalog_product_view.xml <page xmlns:xsi="http://www.w3.org/...
Pawan's user avatar
  • 5,901
4 votes
Accepted

Magento 2 remove Meta Tag robots From whole Website

In such case, you need to override the Magento\Framework\View\Page\Config\Renderer As this class's the method renderMetadata responsible for meta title render. On the override class's at that method ...
Amit Bera's user avatar
  • 77.6k
4 votes
Accepted

How do I change ogg:image only for homepage in Magento?

You could try with an if statement in your head like : if(Mage::getBlockSingleton('page/html_header')->getIsHomePage()) { // Insert og:image meta } or with the page identifier like : if( Mage::...
David's user avatar
  • 392
3 votes
Accepted

How can i check all my categories have META Tags Values (Title, Desc, Keywords)

You can try this ... require_once('./app/Mage.php'); umask(0); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $attributes = array('name', 'meta_title', 'meta_description', '...
sv3n's user avatar
  • 11.7k
3 votes

How to get Meta data in title.phtml on Magento2

A way to get the meta data could be: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $_page = $objectManager->get('Magento\Cms\Model\Page'); $_meta_title = strip_tags($_page-...
Quinten's user avatar
  • 321
2 votes

Magento 2 : Getting rid of meta description tag on product pages

Add strip_tag function to eliminate HTML tags from meta description. File location : /vendor/magento/module-catalog/Block/Product/View.php Search for the function _prepareLayout Update the line ...
Selestin Thomas's user avatar
2 votes

Change Meta tag information dynamically, with Jquery

you can change content with these below code jQuery("meta[property='og\\:url']").attr("content", url); reference
Fme Extensions's user avatar
2 votes

Magento 2 : How to add custom meta tag in head

You can do it by update page_layout/2columns-left.xml <?xml version="1.0"?> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
Nikunj Vadariya's user avatar
2 votes

Customize and override default magento meta tags in <head> for better SEO

I've followed the @Tushar answer, but make it a bit different, lets see how to do that: I've created this event: <event name="catalog_controller_product_view"> <observer name="...
lpFranz's user avatar
  • 689
1 vote

How to remove meta title from head in Magento 2?

di.xml file <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> ...
sandip's user avatar
  • 4,014
1 vote

How to change meta tag "twitter:description" for home page in Magento 2

you can add/edit meta tags from the controller by doing following. 1) Go to your controller file namespace Vendor\Frontendsample\Controller\Index; use Magento\Framework\App\Action\Action; use ...
Hitesh's user avatar
  • 1,569
1 vote

Magento 2 remove Meta Tag robots From whole Website

You do not want to remove the tag from the code as this is a back-end setting. You can change the setting by logging in to your back-office then go to Content -> Design -> Configuration then ...
Pascal Wientjes's user avatar
1 vote

Magento 2 : How to add custom meta tag in head

You can use head.additional and add a new block with a custom class and custom phtml <referenceBlock name="head.additional"> <block class="Vendor\Module\Block\CustomHead" name="...
Ahmed Atef's user avatar
1 vote
Accepted

Customize and override default magento meta tags in <head> for better SEO

You will do some customization for that. Using event Observer you change Product meta description as per your requirement i giving one observer event its usefull for that. <event name="...
Tushar's user avatar
  • 515
1 vote

How to add magento meta description programmatically

Export products (System>Import/Export) and that gives you the csv structure. You can delete all columns but keep sku, store and meta description. Put the data you want into the csv. Save it as UTF-8 (...
jscar's user avatar
  • 787
1 vote
Accepted

1.9: remove specific meta tag from header

No, it is not possible (and makes no sense). It is defined in app\design\frontend\base\default\template\page\html\head.phtml <meta name="robots" content="<?php echo htmlspecialchars($this->...
sv3n's user avatar
  • 11.7k
1 vote

Stop duplicating SEO meta tags while product duplicating

Solution: If you go to your admin panel and navigate to Admin Store -> Configuration -> Catalog > Search Engine Optimization In the Search Engine Optimisation tab, you can find the following two ...
Nikunj Vadariya's user avatar
1 vote

Magento 2: Meta-keywords and meta-description doesn't appear

I've Installed fresh installation 2.2.2 and There was no Meta description or keywords at all. I you are wondering why there isn't anywhere this is for you! Got TO Content->Design->configuration edit ...
Juliano Vargas's user avatar
1 vote

Parse error: syntax error, unexpected '­' (T_STRING) in products\app\code\local\Sahara\Recentproducts\Block\Recentproducts.php on line 8

Seems to be a typo ... Replace: $products = Mage::getModel("recentproducts/recentproducts")­>getRecentproducts(); With: $products = Mage::getModel("recentproducts/recentproducts")->...
sv3n's user avatar
  • 11.7k
1 vote
Accepted

SEO - Adding META ARCHIVE and GOOGLEBOT

Part 1 If you want set it from config you have to add an extension that sets another sourcemodel for for robots config section ... <config> <sections> <design> ...
sv3n's user avatar
  • 11.7k
1 vote

How Can I Import Category META Tags(Titles, Descriptions, Keywords) into DB Using MySQL Query?

You can execute below query. Assumption - Category already created. Also one more thing, you have to replace replace_this_with_category_id with entity_id that will reference to ...
sandip's user avatar
  • 4,014
1 vote

How can i check all my categories have META Tags Values (Title, Desc, Keywords)

This data is all in either catalog_category_entity_text or catalog_category_entity_varchar tables. The following sql will get all the category names (and paths just in case you have duplicate category ...
jscar's user avatar
  • 787
1 vote

characters like æ ø å ö ä ü for display in magento

I think your problem is related to mysql character set of your table. Please check stored data in your database. If data has same problem like the frontend, you should alter your table to "utf8-...
An Huy's user avatar
  • 131
1 vote

How to copy product information to meta information in Magento 1.9.2

To set meta information on the fly (w/o save to product) you can use this ... It sets product name to meta title/keywords and description to meta description: app/code/local/Your/Module/etc/config....
sv3n's user avatar
  • 11.7k
1 vote

How to add meta tag. meta description, meta kywords in custom module of admin panel?

You can add these (meta_title,meta_keyword,meta_description) fields in your module table. Then add this code in your module form of adminhtml $fieldset->addField("meta_title", "text", array( ...
Arunendra's user avatar
  • 7,458
1 vote

How to identify pages and set meta info in Magento

Use your theme file local.xml example for contact page <contacts_index_index> <reference name="head"> <action method="setTitle"><title>Title</title></action> ...
Vitalii's user avatar
  • 608
1 vote
Accepted

Set Meta Titles in Admin with Variable - Magento 1

basically you want generic title for all the product. One way Either extend Mage_Catalog_Block_Product_View Block or just copy view.php from app/code/core/Mage/Catalog/Block/Product to app/code/...
Gopal Patel's user avatar
  • 3,139
1 vote

Magento uses <h1> for the logo on EVERY page - Duplicate h1 tags

Default Magento templates DO NOT set <h1> on the logo by default you can see in app/design/frontend/base/default/template/page/html/header.phtml : <?php if ($this->getIsHomePage()):?> &...
Raphael at Digital Pianism's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible