Your own custom search engine on your blog

Part One: Creating your custom search engine

  1. Head to google.com and sign up for a free account, if you don’t already have one. Log into your new Google account.
  2. Sign up for a free Google Ajax Search API Key.
  3. Head to Google Co-op and click the “Create a Search Engine” button.
  4. You’ll have to think ahead a little for this one. You are going to decide what new file to put your search engine on. It will have an extension of .php and it will be in the same directory as your WordPress installation. Plan out what the URL of your future search engine will be:

    mysite.com/blogdirectory/filename.php

    where “mysite.com” is your domain name, “blogdirectory” is the directory of your WordPress installation, and “filename” is your choice (make sure it has no spaces or punctuation, beyond hyphens).

    For example, I decided to put my search engine in jessibird.net/music-search.php. My WordPress is already in the top level of my site, so I didn’t have to specify a blog directory.

  5. Fill in the fields as directed (there are two pages’ worth) and click the “Finish” button.
  6. Click on the “control panel” link to further customize your search engine. You can add sites, site labels, and preset search refinements.
  7. Good work! You’ve created your search engine. You could stop here, and access it from your Google Co-op homepage. But the point of this tutorial is to put your CSE on your blog, so let’s continue.
  8. From within the Control Panel, click on the “Code” link.
  9. Go to the “Search box and search results code for your website” section and expand it. Enter the URL of your search engine, the one you planned earlier. Select your desired appearance options.
  10. You’ll be shown two boxes of code; one block of code to display the search box, the other to display the search results.
  11. Save both of these code blocks for future use. Copy and paste them into sticky notes or text files or whatever.

Next page: Part Two: Creating your search engine page

If you're new here, you may want to subscribe to my blog's feed. Don't know how a feed works? Take a look at the feed quick start page. Thanks for visiting!

Related posts

Leave a Comment