cancel
Showing results for 
Search instead for 
Did you mean: 

Make filters seo friendly and add nofolow if more than 2 filteres are selected

Make filters seo friendly and add nofolow if more than 2 filteres are selected

Hi. i'm new to magento and i need to make filters url more seo friendly. ex : http://website.com/blugi-dama?culoare=13 to http://website.com/blugi-dama/color/red

also, i need to add nofolow tag if more than 2 filters are selected.  any idea or module? thanks 

2 REPLIES 2

Re: Make filters seo friendly and add nofolow if more than 2 filteres are selected

Hi @iubbbbbbb,

 

You won't get it using Magento OOTB but there are several paid modules that can help you.

Maybe you can start looking at https://marketplace.magento.com/

Re: Make filters seo friendly and add nofolow if more than 2 filteres are selected

if someone need fix..

for nofollow:

copy Head.php file (/app/code/core/Mage/Page/Block/Html/Head.php) to the local directory (/app/code/local/Mage/Page/Block/Html/Head.php)

Here is how to implement modification of the new file:

public function getRobots()
    {
        if (empty($this->_data['robots'])) {
            $this->_data['robots'] = Mage::getStoreConfig('design/head/default_robots');
        }

        //Added NOINDEX, FOLLOW for category page with filter(s)
        if(Mage::app()->getFrontController()->getAction()->getFullActionName() == 'catalog_category_view'){
            $appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();

            //var_dump($appliedFilters);  //<-- uncomment and see filters as array in page source code in meta robots tag.

            if(count($appliedFilters) > 2){
                $this->_data['robots'] = "NOINDEX, FOLLOW";
            }
        }

        return $this->_data['robots'];
    }

url filters fixed with this module https://github.com/Flagbit/Magento-FilterUrls