This module adds Twitter Card meta tags (Summary, Summary Large Image, App, Player) to your Magento 2 store's frontend pages for better social sharing previews.
- Enable/Disable Twitter Card globally
- Set Twitter username and author
- Set card type per page type (CMS, Category, Product)
- Optionally use product thumbnail or fallback images
- Supports multiple fallback images
- Auto-detects dynamic titles and descriptions
- Meta tag rendering via block/template
- Safe for SEO (does not conflict with robots.txt)
- Copy the folder
Themestar/Xcard
intoapp/code/Themestar/Xcard
- Run:
php bin/magento module:enable Themestar_Xcard php bin/magento setup:upgrade php bin/magento cache:flush
Go to:
Stores > Configuration > Twitter Card
There you can:
- Enable or disable the module
- Enter your Twitter
@username
and optionalauthor
- Select card type per page type
- Choose to use product thumbnail
- Upload fallback image(s)
summary
summary_large_image
app
(for mobile apps )player
(for videos )
Template File:
view/frontend/templates/meta/twitter_meta.phtml
To override it, copy it to your theme and adjust as needed.
- Make sure your fallback image is publicly accessible and not blocked by robots.txt
- Validate your pages using Twitter Card Validator
Built by Themestar