Accepting projects ·CZ Get in touch →

Leaving WordPress without losing your search rankings

After moving off WordPress, rankings are most often lost because of old URLs. How to build a redirect map and check it before Google does.

When a company leaves WordPress, its main worry is search rankings. Yet the content moves over easily. Rankings are most often lost because of URLs: an old page disappears and Google finds a 404 error in its place.

Why rankings get lost

Google knows your website by its URLs. Every page that shows up in the results has its own URL, and links from other websites and customers' bookmarks point to it. WordPress creates URLs its own way: /contact/, /category/news/, posts with the date in the path, plus feeds and the /wp-json/ API.

A new website has different URLs, whether it runs on another content management system or is static HTML. If there is no permanent redirect with status code 301 from the old URL, Google drops the page from its index after a while. The links that pointed to it stop helping the website.

The redirect map

The basis is a plain spreadsheet. Every old URL on the left, the new one on the right. Where no new page exists, pick the closest one by content. The home page is the last resort, as Google often treats such a redirect as a missing page.

Don't take the list of old URLs only from the old website's menu. We use these sources:

  • an export of pages from Google Search Console (Performance report, Pages tab)
  • the old website's sitemap.xml file
  • a crawl of the old website with a tool that collects links
  • the WordPress database, if the old website is no longer running

Search Console is the most important of them. It shows the URLs that actually get impressions in search, and variants you wouldn't think of: with and without a trailing slash, older language versions, posts moved several years ago.

When moving a law firm's website off WordPress, we took an export from Google Search Console of the pages that had search impressions and tested each of them with a script. It turned up URLs without a trailing slash that the map had missed, and English pages whose redirects went round in a loop.

Lukáš Hrubý Managing director, HRUBY Software

URLs the new website doesn't have

WordPress exposes a number of URLs the website owner doesn't know about. Feeds, archives by author and date, tags, image attachment pages. Don't carry them over to the new website, but don't let them return an error either if links point to them.

On a smaller company website we moved from WordPress to static HTML, pages like /cenik/ (the price list) led to the new /cenik.html. Feeds and APIs that WordPress creates automatically we redirected to the home page, because the new website has none. The same step includes unifying the domain: the versions with and without www, and with http and https, should lead to one address in a single hop, not through a chain of several redirects.

Step by step

  1. Before the switch, download the page export from Search Console for the longest period possible. After the switch it is hard to compare what used to show up.
  2. Build the map and have it checked by someone who knows the website's content. A developer can't tell which old article has the closest replacement.
  3. Set up the redirects on the server with status code 301. Google doesn't treat redirects in JavaScript or via meta refresh as reliably.
  4. Test every URL from the export. The old URL should return 301 and the target 200. Look for chains and loops. The browser reports them as “too many redirects”.
  5. After the switch, submit the new sitemap in Search Console and watch the report of pages with a 404 error. Add whatever shows up there to the map.

A simple script can do the test. It takes a list of URLs and prints the response code and the redirect target for each:

curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" https://example.cz/kontakt/

When to bring in an expert

You can handle a smaller website with ten pages yourself, following the steps above. Help pays off when the website has hundreds of articles, several language versions, or an e-shop with products that get renamed. The same goes when search traffic has already dropped after the switch and you don't know why. We'll go through the export, add the missing redirects and set them up so they don't loop.

The cheapest option, though, is to build the map before the old website is switched off. You can download the Search Console export in five minutes, and later you won't have anything to build it from.

Written by Ing. Lukáš Hrubý, HRUBY Software · ← All articles

Dealing with the same thing?

We'll look at it with you. The first consultation is free, just get in touch.

Book a consultation →
// Contact

Get in touch.

Tell us what you need, or just call. We reply within one business day.

// Encrypted in transit · privacy policy