302 Redirect vs 301 Redirect – Best Practices (Explained)

Are you wondering what’s the different between 302 vs 301 redirects?

Redirects are important for providing a great user experience and helping search engines better understand your site. 302 and 301 are types of redirects you can use for different situations.

In this article, we will compare 302 redirect vs 301 redirect. We’ll also show the best practices when using redirects in WordPress.

301 vs 302 redirect

302 Redirect vs 301 Redirect – What’s the Difference?

Redirection in WordPress allows you to send users and search engine crawlers to a different URL than the one they clicked on.

You’d need to set up redirects if you delete a page on your WordPress site, move to a new domain, conduct A/B experiments, and more.

Without redirects, users would not be able to see the content they requested. Instead, they’ll see a 404 error page, which is bad for your site’s user experience and search engine rankings.

An example of a 404 page

When it comes to setting up redirects, you’ll come across two most common types: 301 and 302 redirects. Let’s look at each one of them and see what’s the difference.

What is a 301 Redirect?

A 301 redirect is a permanent redirect. If your website or web page has been moved permanently to a new location, then you can use 301 redirects to point users in the right direction.

For example, when a visitor types your site’s address or clicks on a link, the 301 redirect will automatically change the requested address to the new address.

What is a 302 Redirect?

A 302 redirect also helps point users and search engines in the right direction, but temporarily.

Unlike 301, which is a permanent redirect, 302 redirects are temporary. You can move your website traffic to a new location for a limited amount of time and then go back to the original URL whenever you want.

When Should You Use 301 and 302 Redirects?

Now that you know the main difference between the two types of redirections, you may be wondering when is the best time to use 301 and 302 redirects.

Under certain conditions and the goal you’re trying to achieve, it makes sense to use 301 redirects. While in other situations, it is better to use 302 redirects.

When to Use a 301 Redirect?

Since 301 redirects are permanent, here’s when to use them:

When to Use a 302 Redirect?

On the other hand, if you don’t want to point your audience to a new page or another location permanently, then it’s better to use 302 redirects. Here are some situations where using 302 redirection makes sense:

  • Conducting A/B tests for designs, layout, and features of a new website or page
  • Temporarily redirecting users to a sales page or promotional offer
  • Send users to the correct version of your website based on their language or location preference
  • Collect user feedback about a new product or service without impacting your current SEO rankings

Impact of 301 Redirects vs 302 Redirects on SEO

When it comes to using 301 or 302 redirects, you have to consider the impact it will have on your site’s WordPress SEO (search engine optimization).

Search engines work by crawling your website pages using bots and indexing them on the search results. These search engine bots follow links to discover new content and find different pages on your site.

Using the right type of redirection is important if you want to your blog posts to be easily uncovered by search engine crawlers and continue to rank higher on search results.

With 301 redirects, Google and other search engines will know that you’ve moved a site or web page permanently. This way, it will fully pass the link equity or link juice to the new URL. Link equity is like a vote of confidence from other sites that your page is valuable and worth promoting.

On the other hand, if you’re performing a temporary change and don’t want any impact on your original page’s SEO rankings, then it’s better to use 302 redirects. It doesn’t pass the link juice fully and tells search engines that the change is temporary.

How to Set Up 301 and 302 Redirects in WordPress

The easiest way of setting up 301 or 302 redirects on your site is by using a WordPress redirect plugin.

For instance, you can use All in One SEO (AIOSEO) for configuring redirects. It is the best SEO plugin for WordPress and offers a powerful redirection manager tool.

Do note that you’ll need the AIOSEO Pro version to use the redirection manager. There is also an AIOSEO Lite version you can use to get started for free.

First, you’ll need to install and activate the AIOSEO plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you’ll see a welcome screen and the setup wizard. Simply click the ‘Let’s Get Started button’ and follow the onscreen instructions to configure the plugin.

AIOSEO Setup Wizard

You can also see our guide on how to set up All in One SEO for WordPress correctly.

Next, you’ll need to go to All in One SEO » Redirects from the WordPress admin area and click the ‘Activate Redirects’ button.

Activating the AIOSEO redirect feature

Once the Redirection Manager tool is active, you can go to the ‘Redirects’ tab at the top.

From here, you can enter the link that you’d like to redirect in the ‘Source URL’ field. Next, enter the new location for the link under the ‘Target URL’ field.

Enter Source URL and Target URL

After that, you can click the ‘Redirect Type’ dropdown menu and select 301 or 302 redirection.

Once that’s done, simply click the ‘Add Redirect’ button. You can repeat this step and add as many redirects as you want.

If you scroll down, then AIOSEO will show you a log of redirects you’ve created for your website.

View Redirect Logs in AIOSEO

Besides that, AIOSEO also lets you perform full site redirects without any technical knowledge or editing code.

Best Practices for Implementing 302 and 301 Redirects

Setting up redirection on your WordPress website can be complicated. To help you out, here are some best practices to follow.

1. Testing Redirects to Ensure They’re Working

After you’ve set up 301 or 302 redirects, it is better to test each link multiple times.

This is to ensure that the 301 and 302 redirection is working properly. If something goes wrong, then it will be bad for your site’s user experience and SEO rankings.

A simple way to check is by visiting your site in incognito mode and opening the link that you redirected. If it opens the new location, then it means your redirects are working fine.

There are also free tools available on the internet that will check redirection for you. Or you can use the AIOSEO plugin, which shows logs of your redirects inside your WordPress dashboard.

View Redirect Logs in AIOSEO

2. Monitoring Redirects for Broken Links

Next, you should also set up tracking for broken links after adding 301 and 302 redirects to your website.

If you moved a web page to another location or send users to a new page temporarily and the redirection didn’t work properly, then it will result in a broken link. As a result, users will see a 404 error page on your website.

Tracking these broken links after 301 and 302 redirection will help you fix them quickly, provide a better user experience, and avoid any impact on your keyword rankings.

The best way to track broken links is by using the AIOSEO plugin. You can enable the ‘404 Logs’ to start monitoring for 404 error pages.

Enable 404 logs

Do note that initially, you won’t see any data because it will only start recording broken links after you enable the setting.

Once the plugin starts gathering information, you can view broken links on your site under the 404 Logs tab.

Click 404 logs menu option

To quickly fix 404 error pages, you can click the ‘Add Redirect’ option and set up 301 or 302 redirections.

For more details, please see our guide on how to find and fix broken links in WordPress.

PRO TIP: If you want continuous updates on broken links that aren’t just 404 errors, check out our free Broken Link Checker plugin.

3. Avoid Creating Redirection Chains and Loops

A redirection chain is when you have multiple redirects between the source URL and the target URL. Google officially follows up to 10 hops in a redirection chain. If there are more than 10 redirects, then it could show a redirect error in the Google Search Console.

That’s why it is a best practice to avoid redirection chains and point directly to the new location of a website or page. This is especially important when setting up permanent 301 redirects. Having too many 301 redirects can cause errors and lead to poor user experience.

Besides that, you should also try to avoid redirection loops. It occurs when the URLs in a chain redirect back to itself and creates an infinite loop.

As a result, users and search engines won’t see the intended page and instead view the original page. This could also result in a ‘redirected you too many times’ error.

Too many redirects error

One way of fixing it is to remove all redirects in the chain and try redirecting to the final destination.

To learn more, you can see our guide on how to fix too many redirect issues in WordPress.

4. Create Redirects to Avoid Duplicate Content

Another best practice for using 301 and 302 redirects is to avoid duplicate content if your site has multiple subdomains.

For example, if your site’s URL has HTTP and HTTPS, www and non-www, capitalized and lower-case URLs, trailing slashes (/), and more.

Although these subdomains point to the same web address, search engines will view them as separate sites. As a result, it could lead to duplicate content issues. To fix this, you can simply redirect all subdomains to a single website URL.

If you are migrating sites and domains, also, you might use a 302 redirect to show Google and other search engines that you’re moving, and the content won’t be duplicated forever.

You will then have to create 301 redirects to tell search engines which is the preferred version of the content you want them to index.

Additional Resources

Here are some more guides and reading material you can go through:

We hope this article helped you learn the difference between 302 redirects vs 301 redirects and best practices. You may also want to see our guide on what’s the difference between domain name and web hosting and the best live chat software for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 302 Redirect vs 301 Redirect – Best Practices (Explained) first appeared on WPBeginner.

How to Fix WordPress Redirecting to Old Domain After Migration

Do you want to fix the issue of redirecting to an old domain?

When you migrate a WordPress website to a new domain, there is a possibility that users will be redirected back to the old domain.

In this article, we will show you how to fix WordPress redirecting to an old domain after migration.

How to fix WordPress redirecting to old domain after migration

What Causes Redirection to Old Domain After Migration Issue?

When you’re moving your WordPress website to a new domain, it is important to set up redirection. This way, users automatically land on the new location, and you get to keep your keyword rankings and traffic.

However, redirection to a new domain may not work properly, and your visitors would be redirected back to the old domain.

One of the main causes for this issue is that your site URL and home URL values are different in the WordPress database tables. You need to make sure that both these values lead to your new domain.

Besides that, DNS issues can also cause users to redirect to the old domain after migration. If the DNS server is not responding or DNS records haven’t been updated, then your visitors won’t be able to view your new website URL.

That said, let’s see how you can fix WordPress redirecting to the old domain after migration. We will cover different methods, so you can click the links below to jump ahead to your preferred section.

Method 1: Update the Site Address in WordPress Settings

The easiest way to fix this issue is by ensuring that the WordPress address and site address is the same in your WordPress settings.

If your Site Address (URL) still shows the old domain, then users will be redirected to the previous URL after migration.

To fix this, simply head to Settings » General from your WordPress admin panel. After that, enter your new domain under the ‘Site Address (URL)’ field.

Site address URL

Once you’re done, simply save your changes and visit the new domain to see if the problem is resolved.

If, however, the URL fields are greyed out and won’t let you type a new address, continue reading and use one of the other methods to redirect your domain.

Method 2: Changing Site URL in WordPress Database

Another method of fixing the redirecting to the old domain issue is by updating the site URL in the WordPress database tables.

You can easily access the database using the cPanel provided by the WordPress hosting service. For this tutorial, we will be using Bluehost as an example, but the process is similar for other hosting companies like Hostinger, SiteGround, etc.

First, you’ll need to log in to the hosting service control panel. After that, simply click on the ‘Advanced’ tab from the menu on your left.

Bluehost's PhpMyAdmin tool

Next, you can scroll down to the Databases section and click the ‘phpMyAdmin’ option.

You will need to wait for a few seconds until phpMyAdmin opens.

Once it opens, you will need to go to the wp_options table from the navigational panel on your left.

Do note that each hosting service has a different naming convention for database tables. However, the one you’re looking for will always end in ‘_options.”

For example, in this tutorial, we will click the ‘staging_45f_options’ table in Bluehost’s phpMyAdmin.

Open the options table

Next, you will need to edit the ‘siteurl’ and ‘home’ options.

First, go ahead and click the ‘Edit’ button for ‘siteurl’ option.

Enter siteurl

After that, you will need to enter the new domain name in the option_value field. Once that’s done, simply click the ‘Go’ button.

Now, you can return to the main wp_options page and edit the ‘home’ option.

Enter the home field value

Next, you will need to enter the new domain in the option_value field.

After entering the value, click the ‘Go’ button.

Method 3: Flush DNS Cache on Your PC

If you’re still unable to resolve the issue of the old domain redirecting after migration, then you should check the DNS settings.

At times, it can take up to 12 to 48 hours for the change of domain name to take effect. As a result, internet providers that don’t have updated DNS records will redirect users to the old domain.

You simply flush the DNS cache so that it gets the latest information and the new website URL. This also helps resolve the DNS server not responding issue.

For more details, please see our guide on how to clear your DNS cache on Mac, Windows, and Google Chrome.

Pro Tip: Use SEO Plugin to Perform Full Site Redirect

When you manually perform redirection to a new domain, then there is always a chance of errors. As a result, users would still be redirected to the old domain.

An easier way of setting up redirection is by using an WordPress SEO plugin like All in One SEO (AIOSEO). It offers a powerful redirection manager that you can use to redirect your entire site to a new domain without any issues.

Full site redirect in All in One SEO

This tool was built by our team, and it is what we use when we’re migrating websites to a new domain or merging two sites into one. You can learn more by following our step by step guide on how to properly do a full site redirect in WordPress.

We hope that this article helped you learn how to fix WordPress redirecting to an old domain after migration. You may also want to see our guide on the most common WordPress errors and how to fix them and our expert picks for the must-have WordPress plugins for business sites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix WordPress Redirecting to Old Domain After Migration first appeared on WPBeginner.

14-Step Technical WordPress SEO Framework (Proven Checklist)

Do you need a technical search engine optimization (SEO) checklist?

Optimizing your site for search engines can be a challenge if you’re not sure what to look for. Many website owners will ensure basic SEO practices but overlook technical elements.

In this article, we will show a WordPress technical SEO framework and share a checklist you can use for your business.

WordPress technical SEO framework checklist

Why Do You Need a WordPress Technical SEO Framework?

Technical SEO is a key component of your WordPress SEO strategy. You could be creating the world’s best content, but if search engines can’t find and understand your content, then all your efforts are wasted.

That’s why it is important to have a WordPress technical SEO framework.

Our WordPress SEO framework checklist will ensure that search engines can easily crawl and index your content. Plus, you can also evaluate other technical aspects of your WordPress website that might be preventing you from achieving higher rankings.

For example, your website might be taking a long time to load. This would result in poor rankings since the page load time is a ranking factor.

Similarly, you might have mistakenly added nofollow tags and prevented search engines from crawling and indexing your content.

How to Evaluate Technical SEO in WordPress

There are many SEO tools that let you conduct SEO audits and find out if your site is technically optimized. However, not all tools will show details inside your WordPress dashboard.

The easiest way to evaluate technical SEO for your WordPress site is by using All in One SEO (AIOSEO). It is the best WordPress SEO plugin that helps you optimize your website for search engines.

It offers a free SEO Analysis tool that you can use to conduct a technical SEO audit. The tool is available in the AIOSEO Lite version, which you can use for free. There are also premium AIOSEO plans that offer more features like schema markups, sitemaps, redirection manager, and more.

First, you’ll need to install and activate the AIOSEO plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can go to All in One SEO » SEO Analysis from your WordPress admin panel. Under the ‘SEO Audit Checklist’, you’ll see an overall score for your website.

SEO analysis

Next, you can scroll down to the Advanced SEO and Performance sections.

Here, the plugin will evaluate the technical SEO aspects of your website based on different parameters and ranking signals. It will then highlight missing elements and critical issues that could stop your site from ranking higher.

View advanced SEO and performance

You can use AIOSEO to continuously monitor your site’s technical SEO and fix issues. Similarly, you can also perform a competitor analysis and see what they’re doing differently for their technical SEO optimization.

That said, let’s look at our WordPress SEO framework checklist that you can use to ensure higher rankings and organic traffic. You can click the links below to jump ahead to any section:

1. Ensure Your Website is Visible to Search Engines

The first thing you need to check is whether search engines are able to find your WordPress site.

You can simply enter site:example.com in the search engine and see if your website appears in the search results. Just replace ‘example.com’ with your own domain.

Perform site search

If your site isn’t showing up, then you can check the visibility settings in WordPress.

Go ahead and visit the Settings » Reading page from your WordPress admin panel. Next, scroll down to the Search engine visibility setting and be sure the ‘Discourage search engines from indexing this site’ option is unchecked.

Search Engine Visibility Setting in WordPress

This option is usually enabled if your website is under construction or is put in maintenance mode.

2. Uncover Crawling and Indexing Issues

If your website is visible to search engines, then it is important to check that your content is crawled and indexed.

Crawling is the process where Google, Bing, and other search engines discover and understand your website. Indexing is the process where search engines collect and store information about your website.

A simple way of checking crawling and indexing issues is using webmaster tools. For example, Google Search Console is a free tool by Google that shows your site’s performance on search results, helps uncover bugs, and allows you to submit your site to Google.

If you haven’t connected to the webmaster tool, then see our guide on how to add a WordPress site to Google Search Console.

In Google Search Console, you can head to the ‘Pages’ report. Here, you’ll see pages that are indexed and not indexed.

Page indexing in search console

Next, you can scroll down to the ‘Why pages aren’t indexed’ report.

Google Search Console will show you crawling and indexing errors on your website and which pages are affected by them. You can then resolve these issues, so your web pages can appear in Google search results.

Why pages are not indexed

Besides that, you can also check indexing and crawling issues for individual URLs.

Simply enter the page link in the URL inspection tool at the top. Google Search Console will then show you a report on whether the URL is indexed and on Google.

URL inspection tool

If it is not, then you’ll see a ‘URL is not on Google’ message. To fix this, you can click the ‘Request Indexing’ button so Google can crawl and index your page.

3. Make Sure Your Website is Secure with HTTPS

Another important thing to check from a technical SEO framework standpoint is whether your website is secure or not.

Google and other search engines will give preference to sites that use HTTPS over those that use HTTP. To secure your site, you will need an SSL certificate to encrypt the connection between your website server and the user’s browser.

You can check this by looking for the padlock sign in your browser’s search bar at the top.

Look for padlock sign

Most WordPress hosting companies now offer free SSL with all their plans. You can ask your host to see if they offer that.

For more details, please see our guide on how to move your WordPress site from HTTP to HTTPS.

Broken links are bad for your website’s SEO framework, and it negatively impacts your user experience. These are links that no longer exist and will return a 404 error.

Since search engine crawlers find different pages on your website by following internal links. A broken link can stop them from discovering new content. As a result, your page might not get indexed in the search results.

Similarly, if a visitor clicks on a link and is unable to find a page they’re looking for, then they might exit your website.

The MonsterInsights custom 404 error design

With All in One SEO (AIOSEO), you can easily find and fix broken links on your WordPress website.

It offers a powerful redirection manager that helps track 404 errors on your website and lets you set up permanent 301 redirects to fix broken links.

404 error logs in AIOSEO

To learn more, you can follow our detailed guide on how to find and fix broken links in WordPress.

5. Look for Duplicate Versions of Your Site

It is important that Google and other search engines only index one version of your website.

Your website can have different versions, but they should all point to one version. For example, you can have a site that has www and non-www version or HTTP and HTTPS version:

https://www.example.com
https://example.com
http://www.example.com
http://example.com

Whether you choose a www or non-www version, all the URLs should redirect to the primary WordPress URL. Otherwise, Google will consider each version as a different website.

This can negatively impact your overall SEO rankings. Search engines won’t know which version to index, and it could cause duplicate content issues.

You can check the primary URL for your site by going to Settings » General from the WordPress dashboard. Next, look at the web address in the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields.

Look for primary URL

With AIOSEO, you can automatically set the proper canonical URL in your site header, so search engines will know your preference.

6. Use SEO-Friendly URL Structures

After setting a primary URL for search engines to index, you can now check the URL structure of your website.

URL structure plays an important role in your SEO. Having an SEO-friendly URL structure will help Google, Bing, and other search engines easily crawl your pages and understand your content.

Here’s an example of a bad URL structure:

https://www.example.com/category.php?id=42012

Instead, you should be using URLs that describe the content, like:

https://www.example.com/blog/how-to-start-a-wordpress-website

You can create SEO-friendly URLs by making sure that they are short and descriptive. Besides that, don’t forget to include a keyword in the permalinks, use hyphens to separate words, keep all the words in lowercase, and don’t use stop words.

Pro Tip: Don’t include numbers in your URL slugs, either. That way, you can update your content in the future

7. Ensure Your Site is Mobile Friendly

The next item in the technical SEO framework checklist is to ensure your WordPress site is mobile responsive.

With Google now going mobile-first, it will now index your site’s mobile version instead of the desktop version.

You can check your site’s mobile responsiveness by using the free Google Mobile-Friendly Test tool.

Mobile friendly test

Simply enter your website URL and click the ‘Test URL’ button.

The tool will then show results for your website. You can see if it is mobile-ready or not.

See mobile friendly test tool results

If your site is not mobile-friendly, then you can start by changing to a responsive WordPress theme.

You can also follow our guide on how to change your WordPress theme without losing any data or traffic.

8. Check Your Website Speed and Improve Performance

Your website speed is also a critical part of your WordPress technical SEO framework. Google uses page load speed as a ranking factor and will rank fast-loading sites higher compared to slow-performing websites.

You can check website load time by running a site speed test. For instance, you can use MonsterInsights, which is the best Google Analytics plugin that shows a site speed report inside your WordPress dashboard.

You’ll first need to install Google Analytics to your WordPress site using MonsterInsights.

After that, you can head to the Insights » Reports page from your WordPress admin panel. Next, you can go to the ‘Site Speed’ tab. Here, you’ll see an overall score for your website speed for desktop and mobile.

Site speed report

The report will also show other metrics that are important for measuring your website speed.

If you scroll down, then MonsterInsights offers recommendations and benchmark goals for each metric you should target.

Recommendations for improving speed

To improve website load time, you can see our ultimate guide to boost WordPress speed and performance.

A quick tip that you can use to improve your website speed is minifying your CSS and JavaScript files.

The term minified means reducing the size of website files by removing white spaces, lines, and unnecessary characters. When a user visits your website, different files are sent to the user’s browser, which includes CSS, HTML, and JavaScript files.

By reducing the file size, you can significantly improve website speed and performance. There are many WordPress plugins and hosting services that allow you to minify CSS and JavaScript files, like WP Rocket and SiteGround.

For more details, you can check out our guide on how to minify CSS and JavaScript files in WordPress.

9. Improve Your Internal Linking Structure and Remove Orphaned Pages

Internal links play an important role in your website’s technical SEO framework. Search engines reward websites that have a proper internal linking structure without too many orphaned pages.

AIOSEO has a powerful SEO Link Assistant feature that makes it easy for you to discover link opportunities and even automate the process for you.

It is the best internal linking plugin for WordPress that crawls the links on your WordPress website and provides a detailed report. You can see the number of internal links, outbound links, and affiliate links for each post and page.

AIOSEO Link assistant dashboard

You can see all the link suggestions in one place, and it can even automatically go back and add internal links in your older posts with a single click.

Find internal link opportunities and orphaned pages

10. Generate XML Sitemaps and Submit Them to Search Engines

Another important part of technical SEO framework is making it easier for search engines to find your content. One of the ways you can do that is by creating an XML sitemap.

It tells search engines about the important pages on your website. This way, search engine bots can crawl your site faster and index your content. While a sitemap won’t boost your rankings, it will improve the overall crawling and indexing process.

You can create and customize the sitemap using AIOSEO. The plugin will automatically generate a sitemap upon activation. Besides, it also lets you create a video sitemap, a news sitemap, an HTML sitemap, and an RSS sitemap.

AIOSEO sitemap options

Once you’ve created a sitemap, you can then submit it to different search engines using their webmaster tools.

For instance, Google Search Console gives the option to enter the sitemap URL and submit it to the search engine. To learn more, you can see our guide on how to submit your site to search engines.

Submit sitemap to Google

Similarly, you can also add your site to Bing Webmaster Tool and then submit an XML sitemap to improve crawling and indexing.

11. Use Schema Markup for Rich Snippets

The next technical SEO framework item you should check is schema markup. It helps search engines understand your content better and how it will appear on the search results.

You can use schema markup for recipes, reviews, events, organizations, FAQs, blog posts, product pages, multiple locations for local businesses, and more.

Search engines can use this information and display rich results. It also helps capture Google featured snippets, which can increase organic clicks and traffic.

For example, here’s how Google shows recipes, ingredients, ratings, cooking time, and other information for blog posts that use a recipe schema markup.

Recipe schema markup

You can easily add a schema markup in WordPress and WooCommerce using AIOSEO.

The plugin lets you choose the schema type depending on your content, and it takes care of the rest.

Schema markup settings in AIOSEO

With AIOSEO, you can also add completely custom schema markups based on your needs using the WordPress custom schema generator feature. This can help you get star ratings, and other rich snippets in Google.

AIOSEO Custom Schema Generator for WordPress

12. Optimize Your Robots.txt File for SEO

Robots.txt is a text file that specifies instructions for search engine bots on how to crawl your website. You can tell which pages to crawl and which pages to skip while crawling.

Here’s what a robots.txt file would look like for a WordPress site:

User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-admin/
Disallow: /readme.html
Disallow: /refer/
 
Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml

Adding a robots.txt file helps save the crawl quota. A search engine crawler will crawl a certain number of pages during a session. If they don’t finish crawling all the pages on your site, they will resume crawling in the next session.

This can slow down the indexing of your content, and it will appear in search results after some delay. That’s why optimizing the robots.txt file is an important component of the technical SEO framework.

You can disallow pages unnecessary pages like the WordPress admin area, theme folder, plugin files, and more. This way, you get to save the crawl quota and allow search engine bots to crawl even more pages.

On the other hand, you can add sitemaps and other important pages to robots.txt. This way, search engines will crawl and index them as quickly as possible.

A simple way of optimizing the robots.txt file is by using AIOSEO. You can enable custom robots.txt using the plugin and add rules to allow or disallow search engines to crawl.

Optimize robots txt file

To learn more, please see our guide on how to optimize your WordPress robots.txt for SEO.

13. Make Sure Google Doesn’t Flag Your Site for Malware

Another important technical SEO checklist item is to ensure your site isn’t flagged by Google for malware or unwanted software.

If your website is a security risk for users, then Google will show the following warning message:

Google safe browsing malware warning

This can be really bad for your WordPress SEO. It will keep people away from visiting your website, and impact your rankings, and overall website traffic.

To scan for malicious files on your website, you can use a WordPress security scanner. At WPBeginner, we use Sucuri as it is the best WordPress firewall and security plugin. It checks for vulnerabilities like malware, spam injection, malicious code, and helps clean up the website.

You can also take a look at our guide on how to fix ‘this site ahead contains harmful programs’ error in WordPress, if Google flags your site for malware.

14. Use Server Side Rendering vs Client Side Rendering

Another technical SEO best practice is ensuring that your site’s JavaScript renders on the server side and not on the client side.

Server-side rendering is when the JavaScript files render on the website server. While client-side rendering is when the JavaScript files render in the user’s browser.

Client-side rendering is bad for your site’s user experience and SEO. All the burden of loading your site quickly falls on the visitor. Plus, search engine bots use JavaScript resources for crawling and indexing your content. This could result in JavaScript content being missed by crawlers and not included in the search engine index.

With server-side rendering, your website server ensures everything loads quickly. This way, you get a better user experience, faster page load speed, and reduce any risk of content being missed from indexing.

One way of ensuring that JavaScript is rendering on your site’s server is by running a site speed test. If your website speed is low, then it could be because of this issue. You can also look at crawled pages in Google Search Console and see if Google missed any content while crawling. If it did, then it could be because of JaveScript-related SEO issues.

That’s it. You’ve made it to the end of the list. You don’t need to go through each and every point in the technical SEO framework at once. Simply go one step at a time and work your way through the list.

We hope this article helped you learn about WordPress technical SEO framework. You may also want to see our comparison of the best keyword research tools, and our proven tips on how to increase your blog traffic.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 14-Step Technical WordPress SEO Framework (Proven Checklist) first appeared on WPBeginner.

How to Do a Full Site Redirect in WordPress (Beginner’s Guide)

Do you want to redirect your website to a new location?

A full site redirect allows you to easily move your website to a new domain without losing search engine rankings. It helps prevent broken links and provides a smooth user experience.

In this article, we’ll show you how to do a full site redirect in WordPress.

Full site redirect in WordPress

Why Do a Full Site Redirect in WordPress?

A full site redirect allows you to move your entire website to a new location without losing traffic or search engine rankings. When a user enters the old URL of your website in their browser, they will be automatically redirected to the new domain.

It also helps you keep all the backlinks you’ve built over the years and direct them to your new website domain. Your users can easily find all your existing content on the new domain.

A full site redirect also prevents broken links or 404 errors from occurring, which can be bad for your WordPress SEO and user experience.

From a technical point of view, a complete site redirect is a 301 redirect. This type of redirect tells search engines that the page has permanently moved to the new location.

This is the most beneficial type of redirect for your keyword rankings and traffic, and it helps pass the SEO authority of your old domain to the new domain.

That said, let’s see how you can set up a full site redirect in WordPress.

Editor’s Note: Before you set up a WordPress full site redirect to a new domain, it’s important that you transfer all your content first. You can use our tutorial on how to export a WordPress site, or follow our step by step guide on how to move WordPress to a new domain (without losing SEO).

How to Do a Full Site Redirect in WordPress

The easiest way to set up a full site WordPress redirect is by using the All in One SEO (AIOSEO) plugin. It’s the best SEO plugin for WordPress and is used by over 3 million professionals.

AIOSEO helps you optimize your website for search engines without the need to hire an expert. Plus, it offers a powerful redirection manager that allows you to properly redirect users to a new domain without losing SEO rankings while also tracking 404 errors.

For this tutorial, we’ll be using the AIOSEO Pro version because it includes the Redirection Manager. There is also an AIOSEO free version that has all the basic features you need to start optimizing your WordPress website to get more search engine traffic.

First, you’ll need to install and activate the AIOSEO plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can head over All in One SEO » General Settings from your WordPress dashboard and enter the license key. You can find the key in your AIOSEO account area.

Enter license key

To set up AIOSEO on your website and optimize your site for search, you can launch the setup wizard and follow the onscreen instructions. For more details, please see our guide on how to setup AIOSEO in WordPress.

Next, you can head over to All in One SEO » Redirects from the WordPress admin panel and then click the ‘Activate Redirects’ button.

Activate redirects

Once the addon is active, you can go to the ‘Full Site Redirect’ tab under Redirects.

After that, click the ‘Relocate Site’ toggle to display more options.

Enable relocate site toggle

You’ll now see a field where you can enter the new location for your website.

Simply enter the new URL in the ‘Relocate to domain’ field and click the ‘Save Changes’ button. The plugin will automatically redirect everything except the WordPress login page and admin.

Enter new domain address for relocation

To check if your redirection is working, simply enter the old URL in the browser, and it should automatically redirect you to the new domain.

Track and Fix Broken Links in WordPress

When you move to a new domain, it’s always possible that some of the links on your site could break and result in 404 errors. However, with AIOSEO, you can easily track broken links in WordPress and fix them using the redirection manager.

Simply head over to All in One SEO » Redirects from the WordPress admin area and then click the ‘Settings’ tab. Next, enable 404 Logs and Redirect Logs by clicking the toggle.

Enable 404 logs

Once you enable this feature, AIOSEO will start recording 404 errors on your website. Do note that at first, there will be nothing in the logs. It only starts recording 404 errors after you’ve enabled the option.

Once anyone has triggered a 404 error on your WordPress site, you can view the logs by going to the ‘404 Logs’ tab under Redirects.

404 logs menu option

To fix any broken link, simply click the ‘Add Redirect’ option. Then enter the new location under the ‘Target URL’ field and choose your Redirection Type.

After adding these details, simply click the ‘Add Redirect’ button.

Click the add redirect button

For more details, you can follow our guide on how to track and fix broken links in WordPress.

We hope this article helped you learn how to do a full site redirect in WordPress. You can also check out our guide on the best managed WordPress hosting and how to start an online store.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Do a Full Site Redirect in WordPress (Beginner’s Guide) first appeared on WPBeginner.

How to Remove the Date From WordPress URLs

Do you want to remove the date from your WordPress URLs?

WordPress comes with an SEO-friendly URL structure. This includes several link formats, including one that adds dates to your WordPress post URLs.

In this article, we will show you how to easily remove the date from your WordPress URLs.

How to Remove the Date from WordPress URLs

Why Dates Appear in WordPress URLs

By default, WordPress uses a non-human-readable link structure for post and page URLs, which looks like this:

https://example.com/?p=123

This uses the post ID in the URL, which doesn’t look good and isn’t very meaningful.

Luckily, the WordPress Settings » Permalinks page lets you easily change these default links to something more meaningful and SEO-friendly.

WordPress Permalink Settings

Some WordPress users choose the ‘Month and name’ or ‘Day and name’ options. These add date parameters to your WordPress URLs.

‘Day and name’ permalinks include the year, month, and day like this:

https://example.com/2023/09/03/sample-post/

‘Month and name’ permalinks include the year and month:

https://example.com/2023/09/sample-post/

These URLs are better than the default ugly URLs, and they are SEO-friendly as well. However, they are unnecessarily long, and in time, the dates will make your articles look old.

That’s why a lot of users prefer the ‘Post name’ URL structure instead. This removes the date and just uses the post slug keyword in the URL.

‘Post name’ permalinks don’t include any date information in the URL:

https://example.com/sample-post/

This URL structure is shorter, meaningful, SEO friendly, and won’t look dated.

Considerations Before Removing the Date From WordPress URLs

If you are starting a new WordPress blog and haven’t launched it yet, then it is safe to remove the date from WordPress URLs.

However, if your website has been around for some time, then there are a few things you should keep in mind.

Changing the URL structure may result in 404 errors for your users and search engines. This means you might see warnings and errors in your Google Search Console reports.

Plus, your search engine rankings may be affected since backlinks to your old articles will also now lead to 404 errors.

Both of these issues can be fixed by setting up redirects, and we will show you how to do that later in this article.

Changing the URL structure will also reset your social share counts. Unfortunately, most social share count services do not track redirected URLs and will reset the counts.

Removing the Date From WordPress URLs

First, you need to create a complete WordPress backup of your website. This will allow you to restore your website to an earlier stage in case things don’t work out as you expected.

After that, you need to visit the Settings » Permalinks page and choose ‘Post name’ as your permalink option.

Post Name Permalink

Don’t forget to click on the ‘Save Changes’ button at the bottom of the page to store your changes.

WordPress will now remove the date from your WordPress URLs and only use the post name. It will do this both for your existing posts and pages and those you will add in the future.

Setting Up Redirects to Preserve SEO Rankings

Now that you have removed the date from your WordPress URLs, you will need to set up proper 301 redirects. As we said, this will stop your users from seeing 404 error messages when they follow an old link.

These redirects will send users to the updated URLs without showing a 404 error. This will also help search engines understand that the old URLs have been moved to the new URLs.

We will cover 2 methods you can use to create 301 redirects in WordPress:

The best way to set up redirects is using the All in One SEO (AIOSEO) plugin. That’s because it includes a powerful Redirection Manager feature that lets you create bulk 301 redirects as well as automatic redirects, full site redirects, 404 error tracking, and more.

Note: You will need AIOSEO Pro to use the redirection manager. There is also a free version of AIOSEO, but it doesn’t include 301 redirects.

First, you need to install and configure the AIOSEO Pro plugin on your website. For more information, please refer to our step-by-step guide on how to set up All in One SEO correctly.

Once the plugin is active, you will need to go to All in One SEO » Redirects in your WordPress dashboard and then click the ‘Activate Redirects’ button.

Activate AIOSEO Redirects

You’ll now see the ‘Redirects’ tab in All in One SEO, where you can add your first redirect.

On this page, you will see settings where you can enter a ‘Source URL’ and ‘Target URL’.

The source URL will describe the old URL permalink structure, and the target URL will describe the new post URL permalink you need to redirect to.

All in One SEO Redirects Tab

To do this, we will use regular expressions, which are also known as Regex. Regular expressions provide a powerful and flexible way to search and manipulate specific patterns of characters. We will use them to match the permalink pattern in the URLs we need to redirect.

If you were previously using ‘Day and name’ permalinks, then you need to enter these Regex expressions into the source and target fields:

  • Source URL: ^/(\d*)/(\d*)/(\d*)/([A-Za-z0-9-*])
  • Target URL: /$4
Redirecting Day and Name Permalinks in AIOSEO

You will also need to click the cog icon next to the source URL to display three checkboxes. Make sure that only the ‘Regex’ box is checked. This option will enable regular expressions in the source and destination fields.

However, if you were using ‘Month and name’ permalinks, then you will need to enter these Regex values instead:

  • Source URL: ^/(\d*)/(\d*)/([A-Za-z0-9-*])
  • Target URL: /$3
Redirecting Month and Name Permalinks in AIOSEO

Once you have added the source and target URL values, you should make sure that the Redirect Type is ‘301 Moved Permanently’ and then click the ‘Add Redirect’ button.

Your redirect will be created. Now, if a user clicks on a link that uses your old permalink structure, then they will be automatically redirected to the correct post using the new name-based URL.

You can see your redirect by scrolling down to the logs section. You can see how many website visitors have been redirected in the ‘Hits’ column, and you can enable or disable the redirect using the ‘Enabled’ toggle.

AIOSEO Redirects Log

Method 2: Setting Up Redirects Using Redirection (Free)

You can choose our second method if you prefer to use a free plugin.

First, you need to install and activate the Redirection plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit Tools » Redirection and click on the ‘Start Setup’ button.

Start Redirections Setup

The plugin will then show you a couple of options. It can automatically detect and alert you if a post’s URL is changed and keep a log of redirects.

You can also leave both these options unchecked and simply click the ‘Continue’ button.

Continue Redirections Setup

The plugin will then run some tests, and if everything looks good, then you can click on the ‘Finish Setup’ button followed by the ‘Ready to begin!’ button. The plugin settings will be stored in the WordPress database.

You will now see the plugin’s settings page. From here, you need to click on the ‘Add New’ button at the top of the page or simply scroll down to the ‘Add new redirection’ section.

Redirections Settings Page

You will see a form with ‘Source URL’ and ‘Target URL’ fields. The source URL will describe the old URL structure, and the target URL will describe the new URLs.

If you were using the ‘Day and name’ permalinks, then you will enter the following values in the source and target fields:

  • Source URL: /(\d*)/(\d*)/(\d*)/([A-Za-z0-9-*])
  • Target URL: /$4
Redirections Settings for Day and Name Permalinks

If you were using ‘Month and name’ permalinks, then you will enter the following values:

  • Source URL: /(\d*)/(\d*)/([A-Za-z0-9-*])
  • Target URL: /$3
Redirections Settings for Month and Name Permalinks

Don’t forget to select ‘Regex’ from the drop-down menu before you click the ‘Add Redirect’ button to save your changes.

The plugin will now redirect users to your new name-based URLs.

We hope this article helped you learn how to easily remove the date from WordPress URLs. You may also want to see our guide on the most common WordPress errors and how to fix them, as well as our expert pick of the best WordPress SEO plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Remove the Date From WordPress URLs first appeared on WPBeginner.