Did my headline get your attention? The title should have rendered the city you're in or near based on your geographic location. If we couldn't resolve your location it's likely you're seeing the title "Geographically Relevant Titles in WordPress".
While the geographically targeted titles are often used for those spammy dating sites and other ethically challenged web enterprises, they have a very genuine place in online marketing. Certainly, our real-estate and mortgage broker clients that operate Australia-wide have enjoyed a click-through rate over 3 times what they had with a generic title. In my own testing, I've seen conversions of over 600% in some cases when compared against the static alternative.
Why does the CTR increase? People are more likely to click on a post link when the content is personal and relevant. Whatever the purpose, it's almost an absolute assurance that your page visitation will be higher. However, in all cases where you deliver an expectation in a headline, make sure your post honors your geo-based promise. Trickery and click-bait might get a page-view... but it's far less likely to attract genuine brad trust.
The PHP code below utilises our location API to determine a city and country. If the IP can't be resolved, we'll display a static post title instead.
Enable Shortcode in the WordPress Title
Use of shortcodes in the title requires that you enable the_title filter (disabled by default).
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin.
If you're using our custom functions plugin, the filter is enabled by default. If you download our plugin, the above action obviously isn't necessary.
Requirements
- Get the IP Address of a Visitor with PHP (or WordPress Shortcode) - Download.
- Simple Cache With PHP - Download (plugin available).
Our plugin will negate the need for the IP function, and prompt you to download the Simple Cache plugin.
The Shortcode function
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
The shortcode of [geotitle]
will render as defined by the attribute of geotitle
, geotitle_after
, and the location resolved by your IP address.
Shortcode Attributes
The following shortcode attributes are available.
title
title
is a fallback option if your IP address can't be resolved, or the API doesn't respond.geotitle
geotitle
is the optional first part of your title (before the location).geotitle_after
geotitle_after
is optional text that comes after your title.cache
cache
period is the timeframe we'll associate an IP address with location text. By default we'll cache for 10 days. Caching is discussed in more detail below. Any text you enter into your post title field (from your WordPress editor) will always show.
Post Permalink
Your WordPress Permalink (the slugged URL of your page) obviously won't display shortcode. You must change it so it doesn't include the [geotitle]
text. Replace it with anything of your choosing.
Caching
We work on the premise that the majority of visits to your site come from a minority of people. For that reason, we'll associate an IP address with the fully constructed title text and cache it for 10 days (realistically, IP addresses rarely change so it could be far longer). Since we don't want to fill up the database with multiple title records, we require the use of Simple Cache to keep file system records of each IP title (available as a WP plugin).
Considerations
- Caching is necessary. If you make repeated requests to our API for the same address, we'll either return a slow down error response (429) or lock you out completely.
Download
Title: Geographically Targeted Titles in WordPress (WP Plugin)
Description: Geographically targeted titles. Displays a visitor location in your WordPress post or page title.
Download • Version 0.2, 2.6K, zip, Category: WordPress Plugins (General)
WordPress Shortcodes, (824.0B)