Optimising Web 2.0 Directory for SEO

A side-project that I have been running for a number of years is a directory site. I’ve tested many WordPress directory plugin and themes for this project, and I found that the best one for what I wanted to achieve was Web 2.0 Directory aka “w2dc” – available from CodeCanyon.

And whilst the w2dc plugin does integrate with Yoast SEO, the number one SEO plugin for WordPress, there are aspects that can be improved.

First off, some SEO changes to make to any site, not specific to w2dc:

Theme Headers

Something that most WordPress theme writers seem to not appreciate is that you don’t want your site title to be the H1 header on every page of your site. Most themes repeat the site’s Title Tag as an H1 header. The H1 header is the one of most important signals as to what a page is about. So what you really want is your H1 header to be unique and specific to each page, and relevant to the content. That normally means using H1 for the post or page title. The only exception could be your site homepage, where you do want your site title to be H1

So one of the first things I do after installing a theme is to change the heading used for the site title from H1 to H2. Some themes do allow you to choose the heading level, or over-ride the tag in a child theme, but with others you might have to hack edit the theme’s files (which is frowned upon, and you have to remember to do it whenever you update the theme).

The other aspect of your theme to check is what header level it uses for things like widgets in the side bar. Often these are H2, or H3, but you might want to delegate them further depending on the overall header structure of your site. Use a tool like seowebpageanalyzer to check this (see SEO Tips & Tools).

Now we will look at the SEO optimisations you can do the Web 2.0 Directory.

w2dc Headers

Now that you have sorted out your theme’s headers, time to look at w2dc’s headers.

w2dc adds several custom types to your site: Directory Listing, Listing Category, Listing Tag, and Listing Location.

Probably because of the (erroneous) convention that the header of most themes is an H1, the w2dc headers for these custom types is H2.

But for good SEO you want these to be H1, so they are the most important header on each page. These are the templates I changed to achieve this:

  • w2dc\templates\frontend\listing_single.tpl.php
    This template controls how the directory listing custom type is on it’s own single listing page
    change <H2> to <H1>
  • w2dc\templates\frontend\listing_header.tpl.php
    This template controls how the directory listing custom type is displayed. There are two sections, one when the listing is on it’s own page, and one where it’s not, for example on archive pages.
    change <H2> to <H1>
    change second <H2> to <H3> – to match with how I want listings displayed on archive pages.
  • w2dc\templates\frontend\category.tpl.php
    change <H2> to <H1>
  • w2dc\templates\frontend\tag.tpl.php
    This template controls how the directory tag custom type is displayed
    change <H2> to <H1>
  • w2dc\templates\frontend\location.tpl.php
    This template controls how the directory location custom type is displayed
    change <H2> to <H1>

w2dc settings

The directory admin page of w2dc allows for a huge amount of customisation of your directory site. There are two specific options that might help with SEO:

  • Listings permalinks structure: /%listing_slug%/%postname%/
  • Enable breadcrumbs: on

Open Graph Tags

To create a Web 2.0 Directory site, one page in your site must contain the [webdirectory] shortcode, and this is referred to as the directory home page.

The Web 2.0 Directory adds custom types for Directory Listings, Directory Locations, Directory Categories and Directory Tags, and the shortcode handles the output for each of these.

The plugin code sitting behind this shortcode produces the output required based on the passed in URL which allows it to work out the url is requesting a listing, a location, a category or a tag.

The directory controller code has conditionals for each type it is handling. There is also some common code, for example for each type if you have Yoast SEO installed it will call its functions for meta tags.

There are two problems here.

  1. Duplicate Tags.
    For the directory listings custom type the code calls a function which adds the following tags:
  • og:type
  • og:title
  • og:description
  • og:url
  • og:site_name
  • og:image

But if you have Yoast SEO installed, it’s meta and Open Graph functions are also called, adding the following tags:

  • title
  • meta description – if one exists
  • meta robots
  • link canonical
  • og:locale
  • og:type
  • og:title
  • og:description

which means certain tags are duplicated (og:type, og:title, og:description).

2. For all types except directory listings the code does not set an og:image or og:url, and the og:title and og:description are taken from the directory home page , i.e. the page that contains the [webdirectory] shortcode and so are incorrect for categories, tags and locations. This causes a problem when you try to share a category, loaction or tag page to social media.

The shared post will have the title, description and image from the directory home page, not the category page. This does not look great and is not great for SEO.

From the directory point of view the category and tag pages are very important landing pages.

Lets say I have a directory that includes a category for Widget Manufacturers, and I have two listed Foo and Bar. I wouldn’t expect my category page to rank higher than Foo or Bar if someone searches for them by name, but I would like it to rank for more general searches for widget manufacturers. Part of improving the category page’s ranking is to share it on social media with nice looking posts that encourage people to click through. But if it does not display an image (or displays the logo for the first listing on the page) and gives an incorrect title and description for such shares, it is less likely to get any clicks.

So we need to add calls to the directory controller to correct this

  • wpseo_opengraph_url
  • wpseo_opengraph_desc
  • wpseo_opengraph_title
  • wpseo_opengraph_image

The output html shows the difference when this is added:


<title>Widget Manufacturers | Widget Directory UK</title>
<meta name="description" content="Widget Manufacturers UK" />
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<link rel="canonical" href="https://widgetdirectory.uk/categories/widget-manufacturers/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Widget Directory UK | find all your widget needs" />
<meta property="og:description" content="Widget Directory UK is the number one site for widgets" />
<meta property="og:url" content="https://widgetdirectory.uk/" />
<meta property="og:site_name" content="Widget Directory UK" />

After the calls are added, the og tags are corrected and missing tags added:

<title>Widget Manufacturers | Widget Directory UK</title>
<meta name="description" content="Widget Manufacturers UK" />
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<link rel="canonical" href="https://widgetdirectory.uk/categories/widget-manufacturers/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Widget Manufacturers | Widget Directory UK" />
<meta property="og:description" content="Widget Manufacturers UK" />
<meta property="og:url" content="https://widgetdirectory.uk/categories/widget-manufacturers/" />
<meta property="og:site_name" content="Widget Directory UK" />
<meta property="og:image" content="https://i2.wp.com/widgetdirectory.uk/wp-content/uploads/2019/10/widget-manufacturers.jpg?fit=960%2C960&amp;ssl=1" />

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s