How can i Bulk Change Category Page Title, Meta Description/Keywords












0















I need to Change SEO keywords for categories. How can i Bulk Change Category Page Title, Meta Description/Keywords.










share|improve this question
















bumped to the homepage by Community 4 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I need to Change SEO keywords for categories. How can i Bulk Change Category Page Title, Meta Description/Keywords.










    share|improve this question
















    bumped to the homepage by Community 4 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0


      1






      I need to Change SEO keywords for categories. How can i Bulk Change Category Page Title, Meta Description/Keywords.










      share|improve this question
















      I need to Change SEO keywords for categories. How can i Bulk Change Category Page Title, Meta Description/Keywords.







      magento-1.9 category seo update-handle






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 '16 at 10:03







      Gem

















      asked Nov 11 '16 at 9:10









      GemGem

      143632




      143632





      bumped to the homepage by Community 4 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 4 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          i have custom script (not tested)



          <?php
          ini_set("memory_limit","-1");
          ini_set('max_execution_time', 300);
          error_reporting(E_ALL | E_STRICT);
          ini_set('display_errors', 1);
          require_once('app/Mage.php');
          Mage::app();
          //************************ Import CSV File ************************
          // Sample CSV Format
          //category_id meta_title meta_description meta_keywords
          //1986 Test 123 test test, test123
          //1904 Test 123 test test, test123

          $file='category.csv';// Name of CSV file

          $rows = array_map('str_getcsv', file($file));
          $header = array_shift($rows);
          $category_ids=array();
          $csv=array(); //csv array with key as Category Id
          $a=array();
          $i=0;
          foreach ($rows as $row) {

          $csv = array_combine($header, $row);
          }

          /*
          ************************ Array Format ************************
          echo '<pre>';
          print_r($csv);

          Array
          (
          [1986] => Array
          (
          [category_id] => 1986
          [meta_title] => Test 123
          [meta_description] => test
          [meta_keywords] => test, test123
          )

          [1904] => Array
          (
          [category_id] => 1904
          [meta_title] => Test 123
          [meta_description] => test
          [meta_keywords] => test, test123
          )

          )*/

          $category_ids=array_keys($csv); // All the Category Id which we want to update

          //************************ Load Categories which we want to Update ************************
          $category = Mage::getModel('catalog/category');
          $tree = $category->getTreeModel();
          $tree->load();
          $categories = $tree->getCollection()->addAttributeToFilter('entity_id', array('in'=>$category_ids));

          $count=0; //Count
          foreach($categories as $category)
          {
          echo $id=$category->getId().' - <a href="'.str_replace('seoupdate','index',$category->getUrl()).'">'.$category->getName().'</a><br>'; // Print name of categories ;just for our info

          if($csv[$id]['meta_title'] != '')
          $category->setMetaTitle($csv[$id]['meta_title']);

          if($csv[$id]['meta_description'] != '')
          $category->setMetaDescription($csv[$id]['meta_description']);

          if($csv[$id]['meta_keywords'] != '')
          $category->setMetaKeywords($csv[$id]['meta_keywords']);

          $category->save();
          $count++;
          }

          echo $count.' Categories Updated';





          share|improve this answer
























          • Looks great, would be nice if we could export it first too

            – snh_nl
            Mar 6 '18 at 11:12











          • Add loop above this and use get instead of set

            – Gopal Patel
            Mar 7 '18 at 12:03



















          0














          Unlike products by default there's no import/export for categories in Magento. Mage Works created categories import/export functionality on demand for their customer and later on made it available to public Extension Link



          You can export your categories in csv file, make changes and upload it back up. I assume it let's you update meta data but you can make sure it does all what you require before installing it.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145283%2fhow-can-i-bulk-change-category-page-title-meta-description-keywords%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            i have custom script (not tested)



            <?php
            ini_set("memory_limit","-1");
            ini_set('max_execution_time', 300);
            error_reporting(E_ALL | E_STRICT);
            ini_set('display_errors', 1);
            require_once('app/Mage.php');
            Mage::app();
            //************************ Import CSV File ************************
            // Sample CSV Format
            //category_id meta_title meta_description meta_keywords
            //1986 Test 123 test test, test123
            //1904 Test 123 test test, test123

            $file='category.csv';// Name of CSV file

            $rows = array_map('str_getcsv', file($file));
            $header = array_shift($rows);
            $category_ids=array();
            $csv=array(); //csv array with key as Category Id
            $a=array();
            $i=0;
            foreach ($rows as $row) {

            $csv = array_combine($header, $row);
            }

            /*
            ************************ Array Format ************************
            echo '<pre>';
            print_r($csv);

            Array
            (
            [1986] => Array
            (
            [category_id] => 1986
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            [1904] => Array
            (
            [category_id] => 1904
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            )*/

            $category_ids=array_keys($csv); // All the Category Id which we want to update

            //************************ Load Categories which we want to Update ************************
            $category = Mage::getModel('catalog/category');
            $tree = $category->getTreeModel();
            $tree->load();
            $categories = $tree->getCollection()->addAttributeToFilter('entity_id', array('in'=>$category_ids));

            $count=0; //Count
            foreach($categories as $category)
            {
            echo $id=$category->getId().' - <a href="'.str_replace('seoupdate','index',$category->getUrl()).'">'.$category->getName().'</a><br>'; // Print name of categories ;just for our info

            if($csv[$id]['meta_title'] != '')
            $category->setMetaTitle($csv[$id]['meta_title']);

            if($csv[$id]['meta_description'] != '')
            $category->setMetaDescription($csv[$id]['meta_description']);

            if($csv[$id]['meta_keywords'] != '')
            $category->setMetaKeywords($csv[$id]['meta_keywords']);

            $category->save();
            $count++;
            }

            echo $count.' Categories Updated';





            share|improve this answer
























            • Looks great, would be nice if we could export it first too

              – snh_nl
              Mar 6 '18 at 11:12











            • Add loop above this and use get instead of set

              – Gopal Patel
              Mar 7 '18 at 12:03
















            0














            i have custom script (not tested)



            <?php
            ini_set("memory_limit","-1");
            ini_set('max_execution_time', 300);
            error_reporting(E_ALL | E_STRICT);
            ini_set('display_errors', 1);
            require_once('app/Mage.php');
            Mage::app();
            //************************ Import CSV File ************************
            // Sample CSV Format
            //category_id meta_title meta_description meta_keywords
            //1986 Test 123 test test, test123
            //1904 Test 123 test test, test123

            $file='category.csv';// Name of CSV file

            $rows = array_map('str_getcsv', file($file));
            $header = array_shift($rows);
            $category_ids=array();
            $csv=array(); //csv array with key as Category Id
            $a=array();
            $i=0;
            foreach ($rows as $row) {

            $csv = array_combine($header, $row);
            }

            /*
            ************************ Array Format ************************
            echo '<pre>';
            print_r($csv);

            Array
            (
            [1986] => Array
            (
            [category_id] => 1986
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            [1904] => Array
            (
            [category_id] => 1904
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            )*/

            $category_ids=array_keys($csv); // All the Category Id which we want to update

            //************************ Load Categories which we want to Update ************************
            $category = Mage::getModel('catalog/category');
            $tree = $category->getTreeModel();
            $tree->load();
            $categories = $tree->getCollection()->addAttributeToFilter('entity_id', array('in'=>$category_ids));

            $count=0; //Count
            foreach($categories as $category)
            {
            echo $id=$category->getId().' - <a href="'.str_replace('seoupdate','index',$category->getUrl()).'">'.$category->getName().'</a><br>'; // Print name of categories ;just for our info

            if($csv[$id]['meta_title'] != '')
            $category->setMetaTitle($csv[$id]['meta_title']);

            if($csv[$id]['meta_description'] != '')
            $category->setMetaDescription($csv[$id]['meta_description']);

            if($csv[$id]['meta_keywords'] != '')
            $category->setMetaKeywords($csv[$id]['meta_keywords']);

            $category->save();
            $count++;
            }

            echo $count.' Categories Updated';





            share|improve this answer
























            • Looks great, would be nice if we could export it first too

              – snh_nl
              Mar 6 '18 at 11:12











            • Add loop above this and use get instead of set

              – Gopal Patel
              Mar 7 '18 at 12:03














            0












            0








            0







            i have custom script (not tested)



            <?php
            ini_set("memory_limit","-1");
            ini_set('max_execution_time', 300);
            error_reporting(E_ALL | E_STRICT);
            ini_set('display_errors', 1);
            require_once('app/Mage.php');
            Mage::app();
            //************************ Import CSV File ************************
            // Sample CSV Format
            //category_id meta_title meta_description meta_keywords
            //1986 Test 123 test test, test123
            //1904 Test 123 test test, test123

            $file='category.csv';// Name of CSV file

            $rows = array_map('str_getcsv', file($file));
            $header = array_shift($rows);
            $category_ids=array();
            $csv=array(); //csv array with key as Category Id
            $a=array();
            $i=0;
            foreach ($rows as $row) {

            $csv = array_combine($header, $row);
            }

            /*
            ************************ Array Format ************************
            echo '<pre>';
            print_r($csv);

            Array
            (
            [1986] => Array
            (
            [category_id] => 1986
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            [1904] => Array
            (
            [category_id] => 1904
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            )*/

            $category_ids=array_keys($csv); // All the Category Id which we want to update

            //************************ Load Categories which we want to Update ************************
            $category = Mage::getModel('catalog/category');
            $tree = $category->getTreeModel();
            $tree->load();
            $categories = $tree->getCollection()->addAttributeToFilter('entity_id', array('in'=>$category_ids));

            $count=0; //Count
            foreach($categories as $category)
            {
            echo $id=$category->getId().' - <a href="'.str_replace('seoupdate','index',$category->getUrl()).'">'.$category->getName().'</a><br>'; // Print name of categories ;just for our info

            if($csv[$id]['meta_title'] != '')
            $category->setMetaTitle($csv[$id]['meta_title']);

            if($csv[$id]['meta_description'] != '')
            $category->setMetaDescription($csv[$id]['meta_description']);

            if($csv[$id]['meta_keywords'] != '')
            $category->setMetaKeywords($csv[$id]['meta_keywords']);

            $category->save();
            $count++;
            }

            echo $count.' Categories Updated';





            share|improve this answer













            i have custom script (not tested)



            <?php
            ini_set("memory_limit","-1");
            ini_set('max_execution_time', 300);
            error_reporting(E_ALL | E_STRICT);
            ini_set('display_errors', 1);
            require_once('app/Mage.php');
            Mage::app();
            //************************ Import CSV File ************************
            // Sample CSV Format
            //category_id meta_title meta_description meta_keywords
            //1986 Test 123 test test, test123
            //1904 Test 123 test test, test123

            $file='category.csv';// Name of CSV file

            $rows = array_map('str_getcsv', file($file));
            $header = array_shift($rows);
            $category_ids=array();
            $csv=array(); //csv array with key as Category Id
            $a=array();
            $i=0;
            foreach ($rows as $row) {

            $csv = array_combine($header, $row);
            }

            /*
            ************************ Array Format ************************
            echo '<pre>';
            print_r($csv);

            Array
            (
            [1986] => Array
            (
            [category_id] => 1986
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            [1904] => Array
            (
            [category_id] => 1904
            [meta_title] => Test 123
            [meta_description] => test
            [meta_keywords] => test, test123
            )

            )*/

            $category_ids=array_keys($csv); // All the Category Id which we want to update

            //************************ Load Categories which we want to Update ************************
            $category = Mage::getModel('catalog/category');
            $tree = $category->getTreeModel();
            $tree->load();
            $categories = $tree->getCollection()->addAttributeToFilter('entity_id', array('in'=>$category_ids));

            $count=0; //Count
            foreach($categories as $category)
            {
            echo $id=$category->getId().' - <a href="'.str_replace('seoupdate','index',$category->getUrl()).'">'.$category->getName().'</a><br>'; // Print name of categories ;just for our info

            if($csv[$id]['meta_title'] != '')
            $category->setMetaTitle($csv[$id]['meta_title']);

            if($csv[$id]['meta_description'] != '')
            $category->setMetaDescription($csv[$id]['meta_description']);

            if($csv[$id]['meta_keywords'] != '')
            $category->setMetaKeywords($csv[$id]['meta_keywords']);

            $category->save();
            $count++;
            }

            echo $count.' Categories Updated';






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 11 '16 at 9:21









            Gopal PatelGopal Patel

            2,9912930




            2,9912930













            • Looks great, would be nice if we could export it first too

              – snh_nl
              Mar 6 '18 at 11:12











            • Add loop above this and use get instead of set

              – Gopal Patel
              Mar 7 '18 at 12:03



















            • Looks great, would be nice if we could export it first too

              – snh_nl
              Mar 6 '18 at 11:12











            • Add loop above this and use get instead of set

              – Gopal Patel
              Mar 7 '18 at 12:03

















            Looks great, would be nice if we could export it first too

            – snh_nl
            Mar 6 '18 at 11:12





            Looks great, would be nice if we could export it first too

            – snh_nl
            Mar 6 '18 at 11:12













            Add loop above this and use get instead of set

            – Gopal Patel
            Mar 7 '18 at 12:03





            Add loop above this and use get instead of set

            – Gopal Patel
            Mar 7 '18 at 12:03













            0














            Unlike products by default there's no import/export for categories in Magento. Mage Works created categories import/export functionality on demand for their customer and later on made it available to public Extension Link



            You can export your categories in csv file, make changes and upload it back up. I assume it let's you update meta data but you can make sure it does all what you require before installing it.






            share|improve this answer




























              0














              Unlike products by default there's no import/export for categories in Magento. Mage Works created categories import/export functionality on demand for their customer and later on made it available to public Extension Link



              You can export your categories in csv file, make changes and upload it back up. I assume it let's you update meta data but you can make sure it does all what you require before installing it.






              share|improve this answer


























                0












                0








                0







                Unlike products by default there's no import/export for categories in Magento. Mage Works created categories import/export functionality on demand for their customer and later on made it available to public Extension Link



                You can export your categories in csv file, make changes and upload it back up. I assume it let's you update meta data but you can make sure it does all what you require before installing it.






                share|improve this answer













                Unlike products by default there's no import/export for categories in Magento. Mage Works created categories import/export functionality on demand for their customer and later on made it available to public Extension Link



                You can export your categories in csv file, make changes and upload it back up. I assume it let's you update meta data but you can make sure it does all what you require before installing it.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 '16 at 9:29









                DevtypeDevtype

                2,08911131




                2,08911131






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f145283%2fhow-can-i-bulk-change-category-page-title-meta-description-keywords%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Magento 2 controller redirect on button click in phtml file

                    Polycentropodidae