Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • MozCon
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Digital Marketers
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • The Moz Story
      • New Releases
    • Attend MozCon
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      Track your brand’s footprint in AI search
      Moz Pro

      Track your brand’s footprint in AI search

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      Let your business shine with Listings AI

      Let your business shine with Listings AI

      Get found
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • MozCon

        Save on Early Bird tickets and join us in London or New York City

      Access 20 years of data with flexible pricing
      Moz API

      Access 20 years of data with flexible pricing

      Find your plan
    • Blog
    • Why Moz
      • Digital Marketers

        Simplify SEO tasks to save time and grow your traffic.

      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Attend MozCon
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    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. On-Page / Site Optimization
    4. How do I do a 301 Redirect in Wordpress

    How do I do a 301 Redirect in Wordpress

    On-Page / Site Optimization
    4 4 716
    • 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.
    • SteveSweat
      SteveSweat last edited by

      I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site.  I was wondering how to do a 301 redirect for these pages

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

        I would do it with a .htaccess file. If your hosting company has cPanel (or any other good website management software) you can do this with a gui and type the old link and the link in to your browser and hit save, or you can do it manually by creating (or editing) the .htaccess file in the root of your directory. Super fast and secure way of doing it, although you do need to be running apache (et al) not IIS.

        This site has some good info on it

        http://www.josiahcole.com/2007/07/11/almost-perfect-htaccess-file-for-wordpress-blogs/

        As with all things there are a few ways of doing it. This seems to cover most of the exploits that .htaccess files are good at blocking including the 301 redirects.

        Bear in mind that .htaccess 301s using CONDITIONS are regex and certain rules apply such as escaping characters.

        so this doesnt need escaping and is simple

        #redirect old to new
        Redirect 301 /old.php http://www.yourdomain.com/new.php

        but this does, see the . at the end of digg.com is digg.com

        #block referring domains
        RewriteEngine on
        RewriteCond %{HTTP_REFERER} digg.com [NC]
        RewriteRule .* – [F]

        Once you have your 301s in place check the header return to see if its working by using a simple service like this

        http://www.checkmyheaders.com/index.php

        Hope it works 🙂

        Adam

        1 Reply Last reply Reply Quote 1
        • ContactOnline
          ContactOnline last edited by

          Hi Steven,

          I agree with Adam that editing the .htaccess file directly is the best way to do this, however in the interest of you not having that knowledge there are plenty of wordpress plugins that allow you to do 301 redirects either on the fly or a way that's easier to do.

          Here is a link to a search on the wordpress site http://wordpress.org/extend/plugins/search.php?q=301+redirect

          My preference generally is to actually search for the plugins within the Wordpress Admin panel in the menu plugins, then go to add new and type in 301 redirect in the search.From there you'll be able to see a large list along with descriptions and reviews that will help you to narrow down what plugin may suit you.

          It also makes the installation process easier as you don't have to do the whole download then upload stuff it just downloads directly to your Wordpress installs and you then just have to activate it and in some plugins cases change some settings.

          Word of warning though doing 301s should be really thought through before you do them as it makes it permanent so just double check you have the right URLs before you commit them. A client of mine made a huge mistake that took a while to sort out.

          Also something to look at and that's plugins like SEO Yoast as that can allow you to use canonical names, which could help with some types of duplicate pages and for some pages that show up in SEOmoz's campaign reports that you don't want or need showing up. I won't go into more detail as that's not what you were asking, but I figured it's related somewhat so point you in the right direction just in case 😉

          Hope that all helps.

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

            Hi Steven,

            Alan's suggestion of installing the Wordpress SEO by Yoast plugin is right on target.

            This plugin allows you to create a 301 redirect for any post and also to add the canonical link element if you prefer (only for single pages and posts).

            With the plugin installed, to add a 301 redirect, just click the Advanced tab and scroll to the bottom. Enter the URL you wish to redirect the post or page to and click Update. Obviously, the plugin writes the .htaccess rule for you, but if you do want to edit the .htaccess file directly, the Yoast plugin also allows you to do this.

            This plugin also includes a number of other features that allow you to deal with some of the technical shortcomings of Wordpress from an SEO point of view (duplicate content issues etc), so adds a lot of value.

            Hope that helps,

            Sha

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • 301 twice redirect (no negative)
              Christy-Correll
              Christy-Correll
              0
              4
              227

            • To redirect or not to redirect...That is the question
              EGOL
              EGOL
              0
              3
              189

            • How to do this 301 redirection
              AndieF
              AndieF
              0
              3
              111

            • 301 redirect usage
              intSchools
              intSchools
              0
              5
              369

            • 301 redirect -
              aidanlawlor
              aidanlawlor
              0
              4
              324

            • 301 redirect link
              AUSOM
              AUSOM
              0
              4
              583

            • 301 internal redirects
              AmericanOutlets
              AmericanOutlets
              0
              2
              564

            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

            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