The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Content & Blogging
    4. Changing URL structure in WP

    Changing URL structure in WP

    Content & Blogging
    12 5 1.2k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CuMarketing
      CuMarketing last edited by

      Hi there.

      Currently we have our blog (WP site) URLs setup this way:

      companyname.com/post-name

      However, it's hard to analyze blog's (only) content in Google Analytics now (since all posts have their own unique URL).

      I want to change the structure to

      companyname.com**/blog**/post-name

      Question:

      • Is there a way to do it safely?

      • Will I have to 301 all the old links to the new structure or is there any other way to do the switch without losing any links?

      • Thoughts or any (other) suggestions? πŸ™‚

      Thanks much! πŸ™‚

      `Helen

      1 Reply Last reply Reply Quote 0
      • Red_Mud_Rookie
        Red_Mud_Rookie last edited by

        Hi Helen,

        ironically I was jsut logging in to the QnA to ask about WP URLs and URL structures in general!

        If I was you I would 301 redirect them to be safe as this is still the best way to do it according to Google themselves.

        You can use a WP 301 add on like this to do itΒ http://wordpress.org/extend/plugins/simple-301-redirects/

        CuMarketing 1 Reply Last reply Reply Quote 0
        • CuMarketing
          CuMarketing @Red_Mud_Rookie last edited by

          Yeah... 😞 I was hoping there would be a quick fix. .. I am also wondering if it's worth the hassle changing the URLs... again .. I just want to track our blog articles properly, but maybe there's a way to do so without changing the URL structure?

          e.g. I was thinking of simply creating advanced reports for all URLs that include /blog/ ... but again .. if I change the URLs then I will lose all the data from the last 3 yrs ... because I'll have different URLs.... hmm ... Thoughts? πŸ™‚ (I hope I am making sense πŸ™‚

          1 Reply Last reply Reply Quote 0
          • brycebertola
            brycebertola last edited by

            Either way, it's going to be a pain.

            1. 301 forward the old URL's and rewrite the WP URL's to inclue "/blog/"

            2. Create a custom segment in google analytics, filter by "url equals" with each blog url as its' own "OR" declaration.

            1 Reply Last reply Reply Quote 0
            • KeriMorgret
              KeriMorgret last edited by

              I use the Redirection plugin on my site, and you can set it so it automatically creates 301s when you update URLs. I did that when I added a directory to my site and moved some content underneath it. http://wordpress.org/extend/plugins/redirection/

              For URL structure that is friendly with Google Analytics, check out this post over on LunaMetrics. http://www.lunametrics.com/blog/2010/09/22/designing-google-analytics-friendly-site/

              CuMarketing 1 Reply Last reply Reply Quote 1
              • RyanKent
                RyanKent last edited by

                Question:

                **Is there a way to do it safely?Β **

                Will I have to 301 all the old links to the new structure or is there any other way to do the switch without losing any links?

                Your current URLs have the advantage of a clean look, but they don't scale well at all and this is one of the challenges you face. I would suggest having a regex expression written for your htaccess file. Any time a link does not map to a current page (i.e. 404 error) then it could try to add /blog to the URL and try to reach the page. Care would be necessary to restore the original link if another 404 error is received.

                You did not mention the size of your site. The idea of writing hundreds or thousands of 301s manually is simply not reasonable when it can be avoided.

                Thoughts or any (other) suggestions?

                Definitely add the post id to your new URL. I understand you want the "prettiest" URL possible. That desire needs to be balanced with system performance and the user experience.

                For PHP or a database to sort through text fields will definitely cause performance issues as your site grows. When a user does a search your server will not like it, especially if you are on a shared server.

                I would recommend your Pemalink settings to be something along the lines of /blog/%post_id%.%postname%/

                Your final URL will appear as companyname.com**/blog**/123.post-name

                I know you are looking at the URL thinking you don't like the number. Most users will never notice, and it offers multiple advantages.

                CuMarketing 1 Reply Last reply Reply Quote 1
                • CuMarketing
                  CuMarketing @KeriMorgret last edited by

                  Oh, I like this one that it Β does 301 automatically!

                  GA URLs... sigh.. Agreed, too often it's an after thought, eh? 😞

                  1 Reply Last reply Reply Quote 0
                  • CuMarketing
                    CuMarketing @RyanKent last edited by

                    Oh... looks like I accidentally "closed" my question thread .. 😞

                    Here's our blog:Β http://www.cucumbermarketing.com/blog

                    Any other thoughts on how I could track the blog (in its current condition/ URL structure) - an "easy fix" πŸ˜‰ Β I think I will do the redirect though (using one of the plugins recommended below).

                    Sigh... that's what I was trying to avoid .. hehe... But thanks you guys for your suggestions! :))

                    KeriMorgret CuMarketing 4 Replies Last reply Reply Quote 0
                    • KeriMorgret
                      KeriMorgret @CuMarketing last edited by

                      Hi Helen, I opened the thread back up for you so it's not marked answered anymore.

                      The title tags on that site have been somewhat inconsistent, which could actually serve you well. You want to see if all of your blog posts have " | Cucumber Marketing, Vancouver" at the end. The few that I looked at (other than your blog home page) did, while your other pages had slightly different endings on your title tags. If it is unique, that's one way you can separate things out in GA.

                      1 Reply Last reply Reply Quote 1
                      • CuMarketing
                        CuMarketing @CuMarketing last edited by

                        Ohhh... that's right! This may actually work! I will just change the title (ending) for all of my Blog posts, and create an advanced segment with that! Ha! Good thinking, Keri! πŸ™‚ Better than 301'ing the whole blog, huh! Thanks! πŸ™‚

                        1 Reply Last reply Reply Quote 0
                        • KeriMorgret
                          KeriMorgret @CuMarketing last edited by

                          You possibly have a unique ending to your blog posts now, so if you change, you'll not be able to compare prior to now in one easy step. That said, it may be time to look at your title tags site-wide and make things more uniform and have one ending for blogs and one for non-blogs.

                          Glad to be able to help! If you do decide to 301, that redirection plugin is real easy. It's also handy to have anyway, since it can log 404s and let you make redirects from your 404 log. That's handy if someone links to you and types the link wrong, or hyperlinks a period at the end of things.

                          1 Reply Last reply Reply Quote 1
                          • CuMarketing
                            CuMarketing @CuMarketing last edited by

                            Exactly! It's good time to revise all the titles! πŸ˜‰ I think it's way better than 301-ing the whole blog. You never know how this may affect our ranking. It prob. would be fine, but you never know πŸ˜‰ Thanks again! πŸ™‚

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            • Featured Snippet - URL change?
                              0
                              4
                              41

                            • Shortened page titles and changed urls to match, will this effect my page rankings?
                              Lumina
                              Lumina
                              0
                              3
                              224

                            • URL Structure for Blog
                              PeaSoupDigital
                              PeaSoupDigital
                              0
                              4
                              79

                            • Wordpress Overly Dynamic URLs
                              FedeEinhorn
                              FedeEinhorn
                              0
                              4
                              1.1k

                            • With the structure of WordPress when multiple tags are selected, SEOMoz reports show each URL/tag as duplicated content? What to do?
                              SEODinosaur
                              SEODinosaur
                              0
                              3
                              589

                            • URL loss
                              Copstead
                              Copstead
                              0
                              2
                              327

                            • How to titling images in WP blog
                              dittoeffect
                              dittoeffect
                              0
                              2
                              629

                            • Fixing Wordpress URLs
                              dignan99
                              dignan99
                              0
                              4
                              810

                            Get started with Moz Pro!

                            Unlock the power of advanced SEO tools and data-driven insights.

                            Start my free trial
                            Products
                            • Moz Pro
                            • Moz Local
                            • Moz API
                            • Moz Data
                            • STAT
                            • Product Updates
                            Moz Solutions
                            • SMB Solutions
                            • Agency Solutions
                            • Enterprise Solutions
                            • Digital Marketers
                            Free SEO Tools
                            • Domain Authority Checker
                            • Link Explorer
                            • Keyword Explorer
                            • Competitive Research
                            • Brand Authority Checker
                            • Local Citation Checker
                            • MozBar Extension
                            • MozCast
                            Resources
                            • Blog
                            • SEO Learning Center
                            • Help Hub
                            • Beginner's Guide to SEO
                            • How-to Guides
                            • Moz Academy
                            • API Docs
                            About Moz
                            • About
                            • Team
                            • Careers
                            • Contact
                            Why Moz
                            • Case Studies
                            • Testimonials
                            Get Involved
                            • Become an Affiliate
                            • MozCon
                            • Webinars
                            • Practical Marketer Series
                            • MozPod
                            Connect with us

                            Contact the Help team

                            Join our newsletter
                            Moz logo
                            Β© 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                            • Accessibility
                            • Terms of Use
                            • Privacy