Having a Pro Plugin Giveaway at Plugin Planet!
Web Dev + WordPress + Security

Cleaning Up Google Search Results

[ Drawing: Abstract Entity Pursuing Clean Search Results ] This post is about how I cleaned up an incorrect URL in the Google search results. My business site is basically a one-page portfolio site, located at the URL https://monzillamedia.com/.

But in the Google search results, the URL was showing as https://monzilla.biz/, which did not exist. So all potential customers were getting an error page. Fortunately I was able to re-acquire the monzilla.biz domain and redirect all traffic to monzillamedia.com.

Moral of the story

When dealing with transfers and migrations for any major sort of important website, don’t dump the old domain until you absolutely are certain that it’s no longer needed. Before letting it go, check any bounced and/or missing email or webmail on the server. Also look at the site’s error and access logs for any signs of weirdness, like repetitive 404 requests and other notable patterns.

Also — and this is what I had missed — make sure that the search results reflect any changes made to the domain name and other URLs. Otherwise, your site’s search results are at the mercy of the search engine.

While it may cost a few bucks, having access to old domains gives you a bit more leverage in the SEO game.

Be your own hero

If anything, this story highlights the importance of independent skills. Instead of waiting around for someone else (e.g., Google) to fix my problem, I spent about an hour and fortunately was able to find my own solution.

But what if I had not been able to re-purchase that old dot-biz domain? In that case, I would not have been able to re-implement the domain redirect, and thus would have had to rely on the responsiveness and effectiveness of the Google support team. Not that I’m even sure there is such a thing. Or that it’s even possible for any human to update of all things the Google search results ;)

Ask the hard questions

So if you happen to find yourself in the same boat, and are unable to resolve the issue entirely from your side of the equation, there are basically two choices:

  1. Wait for Google to pick up the new URL and update the search results
  2. Report the issue with Google and hope for the best

Either case fails to inspire huge amounts of hope. Why? Well I tried waiting. Yep, two years of 301 redirects and then two months of waiting for the search results to reflect the change. How much longer should I have waited? It’s a serious question..

Timeline of events

A couple of years ago, I transferred the Monzilla site from monzilla.biz to monzillamedia.com. Because dot-biz just.. says something else. So I held on to the dot-biz domain until earlier this year, just in case anything unexpected happened, or for some reason needed to restore access to anything related to the monzilla.biz domain. Like for example, a redirect to the new domain.

To put it into perspective, here is a basic timeline of events:

  1. October 2016 — transferred monzilla.biz to monzillamedia.com, and redirected all traffic (via 301 .htaccess status)
  2. October 2018 — dropped the monzilla.biz domain (and redirects)
  3. December 2018 — noticed the incorrect search results, thankfully re-acquired and restored the monzilla.biz domain and 301 redirect

So for two years I redirected all traffic from monzilla.biz to the new domain. Then two months after dropping the old domain, Google still had not picked up the new domain and correct URL. So losing traffic, customers, reputation, et al.

Another weird thing is that Google Webmaster Tools shows current/correct data from the new domain, monzillamedia.com. So Google knows the correct URL for the site, and shows the site getting traffic, plenty of backlinks, and the full McDeal. So this incident kinda seems like a glitch in the matrix. Would be curious to hear of any similar incidents.

One weird search result..

I’m updating this post with some notes about the actual .htaccess redirect used to successfully route all traffic to the new domain. For two years, I used the following slice of .htaccess to make it happen:

Redirect 301 / https://monzillamedia.com/

That works great to redirect all traffic to the new domain (remember it is a one-page portfolio site, so the all-to-one redirect makes sense). So on my side of the fence everything was redirecting perfectly. Unfortunately, Google was linking to my site with an “s” appended to the URL, like so:

https://monzilla.biz/?s

No idea where the “s” query string came from, but it was included on all incoming requests. Not a big deal by any means, but I tend to obsess about the details and wanted it gone. So I added the following mod_rewrite technique to the new, destination domain:

<IfModule mod_rewrite.c>
	RewriteCond %{QUERY_STRING} ^[A-Z0-9_\-\=]+$ [NC]
	RewriteRule .* / [QSD,R=301,L]
</IfModule>

This code is included in the .htaccess file located on the new domain. So on the old domain redirect all traffic, and on the new domain clean up the incoming requests. An effective combination.

How this code is working? Line-by-line breakdown:

  1. Check if mod_rewrite is enabled
  2. Match any request that includes any alphanumeric characters (or underscore, hyphen, or equal sign)
  3. Remove the query string via QSD flag
  4. Close the check for mod_rewrite

It’s a very effective technique, but you may need to tweak it a bit to suit your specific setup. For example, you may want to refine the regular expression used in the Rewrite Condition, or change the rewrite destination. There are a million ways to extend and customize such a technique, depending on your goals :)

About the Author
Jeff Starr = Web Developer. Security Specialist. WordPress Buff.
Blackhole Pro: Trap bad bots in a virtual black hole.

2 responses to “Cleaning Up Google Search Results”

  1. James McWhorter 2018/12/19 9:08 am

    Yup. Learned this one the hard way a few times!

    Having access to old domain names saves a lot of heartaches. When working with clients – I recommend that they hold on to the unused domain name(s) for few more years (and sometimes even longer) for good measure. The relatively low cost of domain renewal is absolutely worth it.

  2. Hey Jeff nice post,
    i use wp redirection i have since two mont to do a big redirection to client website very nice. I have have had a meta in noarchive in the head … for seeing new 301 more quickly before making all my redirect traffik .In month i have near arround 400 new url updating by Google. Some php configuration like php fpm seems to delete header 301 . thanks for your tricks

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
The Tao of WordPress: Master the art of WordPress.
Thoughts
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Crazy that we’re almost halfway thru 2024.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.