Magento 2 Layered Navigation best setting for SEO
Layered navigation in Magento 2 enhances user experience by allowing customers to filter products based on attributes like price, color, and size. However, if not configured properly, it can harm SEO due to duplicate content and URL bloat. This guide walks you through the most effective settings to optimize layered navigation for SEO in Magento 2, with detailed steps and explanations.
Why Optimizing Layered Navigation Matters for SEO?
- Prevents Duplicate Content: Filter combinations create multiple URLs with similar content, leading to SEO penalties.
- Manages Crawl Budget: Search engines may waste resources crawling unnecessary filter URLs instead of indexing high-value pages.
- Improves User Experience: Well-optimized navigation ensures users find the right products easily, boosting engagement and conversions.
Steps to Optimize Layered Navigation for SEO in Magento 2
Step 1: Enable Search-Friendly URLs
By default, Magento 2 creates query string-based URLs for layered navigation filters (e.g., example.com/category?color=red). These URLs are not user-friendly and can lead to poor SEO performance. To fix this:
- Navigate to Stores > Configuration > Catalog > Search Engine Optimization.
- Set the following options:
- Use Web Server Rewrites: Set to Yes to remove “index.php” from URLs.
- Use Categories Path for Product URLs: Set to Yes to include category names in product URLs.
- Generate Canonical Meta Tag for Categories: Set to Yes.
- Generate Canonical Meta Tag for Products: Set to Yes.
These settings ensure that product and category pages have canonical tags, preventing duplicate content issues.
Step 2: Configure Layered Navigation Settings
To control how layered navigation behaves, go to:
- Navigate to Stores > Configuration > Catalog > Layered Navigation.
- Set Price Navigation Step Calculation:
- Automatic (Equalize Price Ranges): Magento calculates price ranges dynamically based on product prices.
- Manual: You specify the price step manually in the Default Price Navigation Step field.
- Set Display Product Count: Choose No to prevent displaying filter product counts, which can clutter the navigation.
Step 3: Block Unnecessary Filter Pages from Search Engines
Layered navigation can generate thousands of filter-based URLs (e.g., example.com/category?color=red&size=large), many of which have little or no SEO value. To prevent these URLs from being indexed:
- Edit the robots.txt file in your Magento 2 root directory.
- Add the following lines to block specific query parameters:
Disallow: /*?color= Disallow: /*?size= Disallow: /*?price=
By blocking these URLs, you ensure search engines focus on valuable pages like categories and products.
Step 4: Enable Canonical Tags for Filter Pages
Canonical tags help consolidate duplicate URLs by pointing them to a single, preferred URL. To enable canonical tags for layered navigation:
- Go to Stores > Configuration > Catalog > Search Engine Optimization.
- Set Canonical Link Meta Tag for Layered Navigation to Yes.
This ensures that filter pages point to their parent category, avoiding duplicate content issues.
Step 5: Optimize Attribute Settings for Layered Navigation
Configuring product attributes ensures that only relevant filters appear in layered navigation:
- Go to Stores > Attributes > Product.
- Select an attribute (e.g., Color or Size) you want to optimize.
- Set the following options:
- Use in Layered Navigation: Choose Filterable (with results).
- Visible on Catalog Pages on Storefront: Set to Yes.
- Repeat for all attributes you want to use in layered navigation.
Step 6: Add Rich Snippets for Better Search Visibility
Structured data helps search engines display enhanced results (e.g., price, ratings) for your store:
- Use a rich snippet extension or manually add schema markup to your product and category templates.
- Ensure attributes like price, availability, and ratings are included in the markup.
Step 7: Improve Page Load Speed
Layered navigation can slow down your store if poorly configured. To optimize performance:
- Enable Flat Catalog: Go to Stores > Configuration > Catalog > Catalog and enable Flat Catalog Category and Flat Catalog Product.
- Use Full-Page Caching: Enable caching with Varnish or Redis for faster page loads.
- Optimize Images: Compress images to reduce page size.
Best Practices for Layered Navigation SEO
- Focus on User Intent: Only enable relevant filters to reduce unnecessary URLs.
- Monitor Crawl Stats: Use Google Search Console to identify and disallow unwanted filter URLs.
- Use Dynamic Rewrites: Avoid hardcoding URLs; let Magento generate optimized URLs dynamically.
Conclusion
Magento 2 layered navigation is a powerful feature that, when optimized correctly, can improve both SEO and user experience. By following these steps, you can minimize duplicate content, improve your crawl budget, and ensure search engines focus on your store’s most valuable pages. Proper configuration will help you drive more traffic and conversions from organic search.