A WordPress plugin I’ve written with the co-operation of the kind folks at the Libraries Interact blog makes it possible to take links listed in your Blogroll, using the Links Manager, and create a Google Custom Search Engine (CSE) automatically.
Please note that while the plugin is released under the terms of the GPL, using the Google Custom Search Engine service means that Google assumes you agree to their terms of service.
Features of the plugin include:
- Grouping links into categories
- Distinguishing between links that are considered “live” and those that “abandoned”
- Control over the text displayed to the user for various user interface elements
- Managing the colour of elements in the CSE search results display
- Using the Farbtastic library to provide an easier way to select colours
- The URL for the XML Google CSE specification is changed whenever a link is added, edited or deleted, ensuring that the most up to date list of links is always used by the Google CSE
The plugin is currently in use by the Libraries Interact blog to power the list of blogs on the Aussie Library Blogs page.
The source code for the plugin is available under the terms of the GPL from the WordPress Plugins website.
New in Version 1.2
- Compatibility changes with WordPress 2.6
- Improved administrative UI
- Ability to show the search box without the list of links
New in Version 1.1
- Improved error handling for the options form
- Tweaked some areas of the code to support WordPress 2.5
Known Issues
- The Google CSE search box will not work if you’re not using permalinks
Installation Instructions
Installing the plugin takes a number of steps. They are:
- Creating your link categories
- Adding your links to the categories
- Uploading & Activating the plugin
- Configuring the plugin
Also on this page is a list of known issues.
For the plugin to work you’ll need at least one link category. This link category will contain those links that you want to be included in the Google CSE. You can associate the plugin with was many categories as you wish. As an example the Libraries Interact blog groups the list of Australian library blogs into “Personal Blogs” and “Corporate Blogs”.
The plugin can also work with two additional categories. These categories are designed to differentiate between “live” links and “abandoned links”. For example this means that the Google CSE can contain blogs that may still contain useful information and yet have been abandoned. The list of links can then be sorted to remove abandoned links if a user is only looking for blogs that have been updated recently.
Creating and managing link categories is undertaken using the Links Manager feature of WordPress.
Adding your links to the categories
Once the link categories have been created you need to add your links to those categories. You add links to the blogroll and the categories in the normal way using the Links Manager feature of WordPress. Ensure that:
- The links you want to include in the Google CSE are in the appropriate category
- If you’re differentiating between live and abandoned links ensure that the links are also in these categories
An example of the way the table of links in the Links Manager will look is outlined in the screen shot below.
(Clink the image for a larger version)
Uploading & Activating the plugin
- Download the plugin archive
- Unzip the files into a temporary location
- Upload the blogroll-google-cse directory into your wp-content/plugins directory
- Login to the administrative section of your WordPress blog
- Click the Plugins link on the main menu bar
- Click the Activate for the Blogroll to Google CSE plugin
- Click on the Options link on the main menu bar
- Click on the Blogroll Google CSE link on the secondary menu bar
- Select the link categories that should be included under the Link Category Options heading
- If there are “live links”
- Select the category containing the live links under the Live Link Category heading
- If there are “abandoned links”
- Select the category containing the abandoned links under the Abandoned Link Category heading
- Adjust the settings under the User Interface Elements heading
- Adjust the settings under the Google CSE Options heading
- Adjust the colours of elements of the search results using the colour wheel under the Google CSE Colours heading
- Change the Miscellaneous search results display options
- Enter the URL of the page that displays the list of links and the search box into the URL of the Search Page text field under the Search and Results Page URLs heading
- Enter the URL of the page that displays the search results into the URL of the Results page text field under the Search and Results Page URLs heading
- Click the Update Options button
- If you find that links are appearing in the blogroll section of your theme and you don’t want them to. You can either:
- Change the visible status to “no”
- Edit the theme, so the call to the “wp_list_bookmarks” template tag excludes the category (or categories) you’ve put your links into
If you have any questions, queries or comments about this plugin, please contact me by leaving a comment or emailing me at corey@techxplorer.com.






September 9, 2008 at 2:25 am
Trying to activate the plugin I get the following error message. Any hints how to debug?
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /xxx/xxx/xxx/xx/wp-content/plugins/blogroll-google-cse/blogroll-google-cse.php on line 105
September 9, 2008 at 5:54 pm
@Thomas,
Many thanks for trying out my plugin. I’ve looked at the code for version 1.2 of the plugin, the latest, and in my copy line 105 is indeed a function and not a string. This is odd as it doesn’t match the error your describe.
My suggestions at the moment are:
- Upload the plugin again, and if you use FTP ensure it is transferred correctly; and
- Download a copy of the file from your server and send it to me so I can have a look techxplorer@gmail.com.
For reference the code at line 105 in my copy is:
private function is_colour($value) {
Looking forward to hearing from you soon.
September 9, 2008 at 6:17 pm
This blog runs in a subdirectory with index.php in the root directory. I will try another installation with the blog in the root directory.
October 20, 2008 at 9:41 pm
How to monetize my CSE using this plugin ? Since I didnt see something to input my adsense pub-id.
October 21, 2008 at 8:11 am
@Charly,
No, the plugin doesn’t currently have that functionality. Up until now it hasn’t been needed.
It is unlikely to have the functionality added at this time as I don’t have an adsense account to test with.
October 21, 2008 at 6:03 pm
Thx Buddy.. I’m arrived here because I want to create such a blogroll page from my exist CSE, exactly, reverse process of your plugin. However glad to know your work for WP.. many thanx..
November 15, 2008 at 3:42 pm
That’s cool! This is very handy. Will try your instructions later
November 17, 2008 at 2:27 pm
@weeksgo,
I hope the plugin proves useful.