MrinTech

Computers, Technology & More

  • Home
  • Subscribe
  • About
  • Contact
  • Blog Archive
  • Disclaimer
  • Privacy

Enhance your WordPress 404 Page with Google Search

Now you can harness the power of Google Search for your WordPress 404 Error (Not Found) Pages!

wordpress google custom search

If you are blogging over Self Hosted WordPress Installation, than this post tells you How you can add Google Custom Search to your WordPress 404 Error Pages?

HostGator
What is 404 Error (Not Found) Page:

When visitors to your WordPress Blog / Website lands on a particular page which doesn’t exists at all, they get a 404 Not Found Error. Following are some common reasons when a 404 Not Found Page is displayed:

  • Suppose you have a WordPress Page with URL slug as /abcd and some external site linked to this page with a wrong URL slug /abdc. Now when a visitors lands on this Page, your WordPress Installation will give a 404 Error to him/her.
  • You made a Page Private after Publsihng it, now when a Visitor lands on this Page he/she will get 404 Error.
  • There can be some more reasons. You can read more about 404 Not Found Error right here

How to Add Google Custom Search to 404 Not Found Pages?

1. First of all go to Google Web Elements Custom Search Page. Here you will get 3 Options for your Custom Search Engine:

google custom search options

  • Automatically Search My Site – Option common to all users.
  • Search my Site & Use AdSense for Search – This option is useful for those having a Google AdSense Account.
  • Use an Existing Custom Search Engine – If you have created a Custom Search Engine Earlier, than you can simply enter your Custom Search ID (E.g. 012345678901234567890:abcdefghijk)

2. Select Appropriate Option as per your Requirement and copy the JavaScript Code. Now Login to your WordPress Dashboard, Here go to Appearance >> Editor >> 404 Template (404.php)

3. Here you have to insert the Javascript Code in appropriate location with reference to Screenshot Below:

google custom search

(If you face any problem while entering the JavaScript Code, please use the Comment Form below)

4. Save the 404.php Template and it’s all done!

The main advantage of Google Custom Search is that, Related Posts/Pages gets displayed just under the Custom Search Box pertaining to the Search Query. This means your visitors will remain only on the 404 Not Found Error Page, but can search anything included in your WordPress Blog.

Not only this Custom Search Engine be incorporated in WordPress Blogs, you can easily insert it to any Website by suitable editing the HTML/PHP file.

Related Reading: Inserting AdSense for Search in WordPress Blog by Removing WordPress Sidebar, Adding Advertisement Code in between First and Second Post in WordPress and Adding Advertisement between WordPress Header and Posts

Liked this Post? Get free Quality Updates in your Inbox. Please Enter your E-mail Address Below OR For More Subscription Options Click Here

Sharing is Caring
  • Facebook
  • Twitter
  • del.icio.us
  • StumbleUpon
  • Google Bookmarks
  • Reddit
  • FriendFeed
  • blogmarks
  • Digg

Related posts:

  1. Remove Sidebar & Add Google AdSense Search within your WordPress Blog
  2. Insert Ads between WordPress Header, Posts & Sidebar
  3. How to Apply for Guruji Ads Network?
  4. How to Insert Ads Between First Post and Second Post in WordPress?
  5. Hide/Mask Affiliate Links in your Blog/Website
  6. How to Track WordPress Blog Visitors in Real Time from Dashboard?
  7. WordPress XML and XHTML Sitemap
  8. Create/Generate Image XML Sitemap for WordPress Blog
  9. Now Read Out a Blog in Robots.txt File!
  10. Akismet is MUST for Every WordPress Blog!

September 17th, 2009 Google, Web, Wordpress

Custom Search Engine, Google, Search, Wordpress

Loading

2 Responses to “Enhance your WordPress 404 Page with Google Search”

  1. Adrian on September 17, 2009 at 8:41 pm

    Oh heck that this does not work on WordPress.com blogs!

  2. mrintech on September 17, 2009 at 11:08 pm

    Yes! That’s one of the Downside of WordPress.com Blogs

Comments are closed.

    Subscribe

    Subscribe to Mrintech

    Advertisement
    Sites We Like
    • BollyGeek
    • iTech7
    • Leased Lines
    • Phoenix: Anirudh's Blog
    • Polycom Soundstation 2
    • SDSL
    • VPN
    • What's On My PC
Home | About | Contact | Advertise | Web Hosting | Connect With Us | Sitemap | Disclaimer | Privacy
Copyright © MrinTech. Performancing's Treasure Theme by Randa Clay. Proudly powered by WordPress