Changing a page URL, deleting old content, or moving a post to a new location can create broken links on your WordPress website. When visitors click an old URL and land on a 404 error page, it creates a poor user experience and may also affect your websiteβs SEO performance.
URL redirects help solve this problem by automatically sending users and search engines from an old URL to the correct new destination.
In this guide, youβll learn how to redirect a URL in WordPress using four easy methods. Youβll also learn about common redirect types, mistakes to avoid, and how to check whether your redirect is working properly.
Table of contents
Key Highlights
- A URL redirect sends visitors and search engines from an old URL to a new destination.
- A 301 redirect is best for permanent URL changes because it tells search engines the page has moved permanently.
- You can redirect a URL in WordPress using a redirect plugin, the .htaccess file, the functions.php file, or your hosting control panel.
- Always test redirects after setup to make sure they work correctly and return the right status code.
Common Types of URL Redirections
Common types of URL redirections include 301, 302, 307, 308, and meta refresh redirects, each used for different situations depending on whether the move is permanent or temporary.
1. 301 Redirect
A 301 redirect is a permanent redirect that tells browsers and search engines a page has been permanently moved to a new URL. It is the most commonly used redirect type in WordPress and is ideal when you change a page URL, delete an old page, move content to a new location, or migrate your website to a new domain.
From an SEO perspective, a 301 redirect is the best option because it transfers most of the original pageβs ranking value and authority to the new URL.
2. 302 Redirect
A 302 redirect is a temporary redirect. It tells search engines that the page has moved for a short time, but the original URL may be used again in the future. This type of redirect is useful when you are running a temporary promotion, testing a new landing page, or redirecting visitors during website maintenance.
Unlike a 301 redirect, a 302 redirect does not tell search engines to permanently replace the old URL with the new one. That is why it should only be used for temporary changes.
3. 307 Redirect
A 307 redirect is another form of temporary redirect that preserves the original request method while redirecting users to a different URL. It is mainly used in modern HTTP protocols where maintaining request data is important.
307 redirects are useful for temporary server-side redirects, especially when forms, login requests, or data submissions are involved. Compared to a standard 302 redirect, it provides stricter handling of browser requests and helps maintain consistent functionality during temporary URL changes.
4. 308 Redirect
A 308 redirect is a permanent redirect similar to a 301 redirect, but it is stricter in how it handles requests. It tells both browsers and search engines that the page has permanently moved to a new URL and that the original request method (like GET or POST) must remain unchanged during the redirect.
Unlike a 301 redirect, which may sometimes change the request method in certain cases, a 308 redirect ensures that form submissions, API requests, or any data sent by the user are preserved exactly as they were. This makes it especially useful in modern web applications where data integrity is important.
5. Meta Refresh Redirect
A meta refresh redirect is a browser-level redirect that automatically sends users to another page after a short delay. Unlike server-side redirects, it is implemented using HTML meta tags within the webpage itself.
Meta refresh redirects are sometimes used for simple delayed redirections or notification pages. However, they are generally not recommended for SEO because search engines may not treat them as efficiently as proper server-side redirects like 301 or 302 redirects.
You may also read: How to Find Your WordPress Login URL and Make It Secure?
How to Redirect a URL in WordPress?
You can redirect a URL in WordPress using plugins like Redirection or Yoast SEO, by editing the .htaccess file, by adding PHP code in functions.php, or through your hosting cPanel redirect tool. Each method helps send users from an old URL to a new one, with 301 redirects being best for SEO.
Method 1: Redirect a URL Using a WordPress Plugin
Using a WordPress plugin is the easiest way to redirect a URL, especially for beginners. This method does not require coding and allows you to manage redirects directly from your WordPress dashboard. Popular redirect plugins include Redirection, Rank Math SEO, All in One SEO, Yoast SEO Premium and 301 Redirects.
To redirect a URL using a plugin, follow the steps below:
Step 1 – Install the Plugin:
In your WordPress dashboard, go to Plugins > Add New. Search for plugins like Redirection, click Install Now, and then click Activate.

Step 2 – Open Plugin Settings:
Go to Tools > Redirection. If you are using the plugin for the first time, complete the basic setup wizard.

Step 3 – Add a New Redirect:
Source URL: Enter the old page path, such as /old-page/.
Target URL: Enter the full URL of the new destination, such as https://example.com/new-page/.

Step 4 – Choose Redirect Type:
Select 301 Permanent Redirect if the old URL has permanently moved to the new URL.
Step 5 – Save the Redirect:Β
Click Add Redirect to save your changes.

Method 2: Edit the .htaccess FileΒ
The .htaccess file is a powerful server configuration file used on Apache-based hosting that allows you to create redirects without using any plugin. By adding specific rules directly into this file, you can set up fast and reliable redirects at the server level. However, it should be used carefully. Always take a backup before making any changes to the .htaccess file.
To redirect a single URL, you can add this code:
Step 1 – Access Your Website Files:
Log in to your hosting account and open File Manager. You can also use an FTP client to access your WordPress website files.
Step 2 – Find the .htaccess File:
Open the root folder of your WordPress installation. This is usually the public_html folder. Look for the .htaccess file inside this folder.
Step 3 – Create a Backup:
Before making any changes, download a copy of the .htaccess file to your computer. This helps you restore the original file if something goes wrong.
Step 4 – Add the Redirect Code:
Add the following code to redirect an old URL to a new URL:
Redirect 301 /old-page/ https://example.com/new-page/
Step 5 – Save the File:
Save the updated .htaccess file and upload it back to your server if you are using FTP (File Transfer Protocol).
Method 3: Redirect a URL Using functions.php
Another way to create redirects in WordPress is by using the functions.php file in your theme. This method uses WordPressβs built-in wp_redirect() function to send users from one URL to another.
It is mainly used by developers for custom redirects or conditional redirects based on user behavior. However, changes in functions.php should be handled carefully, as errors can affect your site’s functionality.
To set up a redirect using functions.php, follow the steps below:
Step 1 – Open Your Theme File Editor:
In your WordPress dashboard, go to Appearance > Theme File Editor.
Step 2 – Find the functions.php File:
From the theme files list, open the functions.php file. It is usually available inside your active theme folder.
Step 3 – Add the Redirect Code:
Paste the following code at the end of the functions.php file:
add_action(‘template_redirect’, function() {
if (is_page(‘old-page’)) {
wp_redirect(home_url(‘/new-page/’), 301);
exit;
}
});
Step 4 – Change the Page Names:
Replace old-page with your old page slug and replace /new-page/ with your new page URL.
Step 5 – Save the Changes:
Click Update File to save the code.
Method 4: Redirect URLs Through Hosting Control Panel
Many hosting providers offer built-in redirect tools inside their hosting dashboard or cPanel. This method allows you to create redirects without installing a WordPress plugin or editing code manually.
To configure a URL redirect through your hosting control panel, follow the steps below:
Step 1 – Log in to Your Hosting Account:
Open your hosting providerβs website and log in to your hosting dashboard or cPanel.
Step 2 – Open the Redirects Tool:
Find and open the Redirects option. It is usually available under the Domains section.
Step 3 – Select the Redirect Type:
Choose 301 Permanent Redirect if the URL has moved permanently, or 302 Temporary Redirect if it is only temporary.
Step 4 – Choose Your Domain:
Select the domain where you want to create the redirect.
Step 5 – Enter the Redirect URLs:
Add the old URL path, such as /old-page/, and enter the new destination URL, such as https://example.com/new-page/.
Step 6 – Save and Test the Redirect:
Click Add, Save, or Create Redirect. Then open the old URL in your browser to make sure it redirects to the new page correctly.
You may also read: WordPress widgets tutorial: All in one guide
Common WordPress Redirect Mistakes to Avoid
When creating redirects in WordPress, avoid using the wrong type, like a 302 redirect for a permanent move. Also, avoid redirect chains and loops, ignoring trailing slashes, sending all old pages to the homepage, and forgetting to update or test internal links after setup.
1. Using the Wrong Redirect Type
One of the most common mistakes is using a 302 temporary redirect when the page has moved permanently. For permanent URL changes, always use a 301 redirect because it tells search engines that the old URL has been replaced by the new one.
2. Creating Redirect Chains
A redirect chain happens when one URL redirects to another URL, and then that URL redirects again.
For example:
old-page β new-page β final-page
This can slow down your website and make it harder for search engines to crawl your pages. It is better to redirect the old URL directly to the final destination.
3. Creating Redirect Loops
A redirect loop happens when two or more URLs keep redirecting to each other.
For example:
page-a β page-b β page-a
This prevents visitors from reaching the page and may show an error in the browser. Always test your redirects after setting them up.
4. Ignoring Trailing Slashes
A trailing slash is the / at the end of a URL, such as https://example.com/old-page/. In some WordPress setups, URLs with and without trailing slashes may be treated differently. If you ignore this while creating redirects, the redirect may not work properly or may create duplicate URL issues.
To avoid this mistake, always check the exact format of your old URL before adding a redirect. If your original URL ends with a slash, include the slash in the redirect rule.
5. Redirecting All Old Pages to the Homepage
Some website owners redirect every deleted or old page to the homepage. This is not a good practice because users may not find the information they were looking for. Instead, redirect each old URL to the most relevant page, post, category, or service page.
6. Not Updating Internal Links
Redirects help visitors reach the right page, but you should still update your internal links. If your website keeps linking to old URLs, it creates unnecessary redirects and can affect site performance. After creating a redirect, update menus, buttons, blog links, and page links to point directly to the new URL.
7. Forgetting to Test Redirects
After setting up a redirect, always test the old URL in a browser. You can also use a redirect checker tool to confirm the redirect type and final destination. Testing helps you catch problems like wrong URLs, redirect loops, or redirects that do not work properly.
You may also read: How to Add a Navigation Menu to a WordPress Site?
How to Redirect an Entire Website to a New Domain?
Redirecting an entire website to a new domain is best achieved using a permanent 301 redirect at the server level (.htaccess) or via domain registrar forwarding.
Method 1: Using .htaccess (Apache Servers)
The .htaccess method is one of the most reliable and SEO-friendly ways to redirect an entire website. It works at the server level and ensures that all pages from the old domain redirect to the corresponding pages on the new domain.
Steps:
Step 1: Access your old site’s root directory via FTP or File Manager.
Step 2: Locate or create the .htaccess file.
Step 3: Add the following code to the top of the file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
Step 4: Replace olddomain.com and newdomain.com with your actual domains.
Step 5: Save the file.
Method 2: Domain Register Forwarding
This method is provided by domain registrars like GoDaddy, Namecheap, or Google Domains. It allows you to forward your entire domain to a new domain without accessing hosting files.
Steps:
Step 1: Log in to your domain registrar (e.g., GoDaddy, Namecheap).
Step 2: Find Domain Forwarding or DNS Management settings.
Step 3: Choose 301 (Permanent) as the redirect type.
Step 4: Enter the new domain URL.
Step 5: Select βForward with maskingβ (optional, but generally not recommended for SEO) and ensure βpath forwardingβ is enabled to pass URL structures.
Method 3: cPanel Redirects
cPanel provides a built-in option to redirect an entire domain using a simple interface. This method is beginner-friendly and does not require coding knowledge.
Steps:
Step 1: Log in and navigate to Domains > Redirects.
Step 2: Select Permanent (301).
Step 3: Choose the old domain from the dropdown.
Step 4: Enter the new domain in the “Redirects to” field.
Step 5: Select Wild Card Redirect to ensure ://old.com goes to ://new.com.
Step 6: Click Add.
You may also read: How to Reset a WordPress Site?
Conclusion
Redirects are an essential part of managing a WordPress website, especially when updating URLs, deleting content, or migrating to a new domain. When implemented correctly, they help maintain SEO rankings, preserve website traffic, and ensure a smooth user experience without broken links or 404 errors.
By using the right redirect methods, whether through plugins, .htaccess, functions.php, or hosting tools, you can efficiently manage both simple and advanced redirect needs. It is also important to choose the correct redirect type (especially 301 for permanent changes) and regularly test your redirects to avoid errors.
Frequently Asked Questions (FAQ)
1. How to redirect HTTP to HTTPS in WordPress?
You can redirect HTTP to HTTPS by updating your WordPress settings, using a plugin like Really Simple SSL, or adding a redirect rule in the .htaccess file.
2. How to check if a redirect is working?
You can check if a redirect is working by entering the old URL in a browser and confirming that it automatically loads the new page without showing a 404 error. You can also use online redirect checker tools like WhereGoes or Redirect Checker to verify the HTTP status code and final destination URL.
3. How to Perform Bulk URL Redirection in WordPress?
You can perform bulk URL redirection in WordPress by using a redirect plugin that supports CSV import, such as Redirection, Rank Math, or All in One SEO, and uploading a file with old URLs and their new destination URLs.
4. Do redirects affect SEO?
Yes, redirects can affect SEO. A proper 301 redirect helps preserve SEO value, while poor redirects like chains, loops, or wrong redirect types can hurt rankings and user experience.
5. How to minimize redirects on your WordPress site?
To minimize redirects on your WordPress site, focus on updating internal links, consolidating redirection rules, and offloading necessary redirects to the server level.






