In this blog, we are going to explain to you how to add image alt tags for category age in Magento 2. By default, Magento 2 doesn’t provide the feature to add alt tags for category page images, but It will be very helpful for SEO purposes. If you want to add an image alt tag on the category page in Magento 2, follow the below steps.
Step 1: First we need to create the module.xml file app/code/Webiators/CatImgAltTag/etc/module.xml
Step 2: We need to create the InstallData.php
app/code/Webiators/CatImgAltTag/Setup/InstallData.php
Step 3: In the second step we need to create the category_form.xml file to Show the attribute in the backend app/code/Webiators/CatImgAltTag/view/adminhtml/ui_component/category_form.xml
Step 4: After that, we need to create image.phtml file
app/code/Webiators/CatImgAltTag/view/frontend/templates/category/image.phtml
Step 5: In the last step, we need to create catalog_category_view.xml at the following path
app/code/Webiators/CatImgAltTag/view/frontend/layout/catalog_category_view.xml