Landingsites++, offer internal search results for people arriving from search engines

When search engine display relevant results from your blog, they usually display only the highest ranked page matching the search terms. People coming from the search engine, take a look at the page, and if they do not find what they are looking for, they might leave without ever having any clue that your blog contains more information which is relevant to to what he is searching for.

The original landing sites plugin by the undersigned offered a way to show to the visitor referred by a search engine a list of post which might be of an interest to him. Landingsites++ is a rewrite of that plugin with added administration functionality and some changes in its operation.

How does it work:

When a visitor enters the site, the plugin inspects the URL of the page which had referred him to the site. If the URL contains a parameter which resembles a google search (contains a “q” parameter) then the plugin displays in a configurable place a list of posts which have an exact match with the search terms used by the visitor. If there are more relevant post results then the plugin is configured to show, it can be configured to offer a full internal search for the search term.

Configuration options:

The configuration option are accessible from the admin window under the options/landing sites++/

  • Welcome message - The message which gives the visitor some idea of what is the meaning of the links which follow it. Two special strings can be used to insert the name of the search engine and the search terms, and the message can formatted using HTML tags.
  • Link formatting - By using HTML tags it is possible to format how the links will be shown.
  • Internal Search referral - Use to configure the use and display of the automatic referral to the internal search
  • Maximal number of result to display - The maximal number of links to related posts to show
  • Placement - where to place the list of link, at the top the page or its bottom. Neither should be selected if you intend to manually change your theme.

Deficiencies:

  • The plugin requires that the blog is hosted on a system which uses MYSQL 4.1 and above. Since this is the minimal requirement for wordpress 2.2, I guess it should not be a problem.
  • Most popular search engines use the “q” convension, but not all of them. In case there is a search engine you realy need to support which do not follow this convention, it should be easy to change the mk_landingsites_get_delim function to support it.
  • The parsing of the search is very naive and assumes that each word in the search terms should match. the plugin do not attempt to understand any of the options which can be used when searching with a search engine.
  • The internal search being done searches only the titles and posts. Comments are not being searched.
  • The placement configuration options work only with themes which are compatible with the recomended wordpress 2.0 loop structure. If it does not work for you, you will have to edit the theme.

How to manually change the theme to support the plugin functionality

The easiest way is to place the following line

<?php mk_landingsites_startloop(); ?>

wherever you want the list of links to appear.

If you need more control then that, you may use the following functions:

  • mk_landingsites_get_referer(). Return the search site from which the visitor was referred.
  • mk_landingsites_get_terms(). It reurns an empty string if the blog was not referred from a search engine, or the search term if it did.
  • mk_landingsites_internal_search($terms, $limit). Returns an array of results for searching after $terms , with a maximum of $limit results. The array contains up to $limit arrays of results, sorted by their relevance. Each array contains an ‘ID’ of the post, its ‘post_title’ and ‘post_content’.

Installation:

Download this file, and upload it to your wordpress plugins directory (or even better create an mk_landingsites directory under the plugins directory and upload the file to there).

In the administration window change the plugin setting and activate it.

License:

Free for use, and modification for personal and not for profit usage.

You may not redistribute the code.

Leave a Reply