Using the WordPress Admin for Lead Generation

If you are like me then you spend a lot of your day navigating around the WordPress admin, looking at the admin screens to carry out different tasks. For the right type of client, they probably spend a lot of time in there too. Therefore I thought it was a good idea to try and use the WordPress admin as a little marketing opportunity. Here is how I went about it.

This all started out with me asking the question of how can I get across to current clients the other work and services that I could offer them. My website is not great, it is just a blog (something which I need to work on!) but usually you would list your service and products on your site. However it is probable that current clients don’t really visit your website that often, after all they already have a relationship with you and contact you in other ways.

Therefore I wanted to explore ways in which I could get this information across to clients. I started to think what is the one place that I have access to add content too, which all my clients see on a regular basis. I have clients that spend much of their days in the WordPress admin, managing their sites content to generate them leads and therefore I thought that I could use the admin in some way to engage clients with new content and services from me.

For a while now I have been using a plugin I wrote called WP Basis to make some changes to the WordPress admin screens in order to make the experience easier for clients to use. The plugin takes away some of the unwanted stuff such as menus and meta boxes that are not used and would just confuse the client. However one thing that it did do was to provide a different dashboard screen for clients, rather than the complicated default dashboard.

The default WordPress Dashboard Screen can be a little complicated at first glance.
The default WordPress Dashboard Screen can be a little complicated at first glance.

With this in mind I went about altering this dashboard screen the client sees to include some additional information. The following assumes that you already have a plugin that adds a custom dashboard page for your clients. If you need a little more help with this take a look at how I have done this with the WP Basis plugin on Github.

The approach I decided on was to use tabs. I wanted to make the dashboard feel as native a possible, fitting in with other WordPress admin styles etc. There is already a tabbed section on the WordPress About page. This is the page you are directed to when you have upgraded to the latest version and therefore it seemed logical to use the same approach.

The WordPress About page already contains a series of tabs.
The WordPress About page already contains a series of tabs.

I added the following function to output the content of the new dashboard page.

The above code adds the welcome tab and I have made this code extensible so that I can add tabs in the future using other plugins to show other things. The tabs work in that you declare a tab and a tab name using a filter and then you do the same declaring the callback function for the tabs content. You then create a function with the same name as your callback in order to show whatever content you like here.

Making it extensible means that I can use the base plugin on all sites (WP Basis) and then add other plugins which add tabs and tab contents to the client dashboard. Below is an example of a tab that was added to one site – this actually advertised services for another agency as it was a site built by me for them! Each linked through to their website with information about the service.

An example of a tab added to provide information about other services.
An example of a tab added to provide information about other services.

This is very much work in progress and I have lots of ideas for other content to appear on the dashboard of clients. Some ideas are below:

  • Use RSS to grab the latest blog posts and display them on the dashboard
  • Show latest offers and promotions. Again this could done using an RSS feed from another WordPress site which would automate this.
  • Videos of how to use the site
  • Contact form for support, which creates a ticket on your support system

What do you think? I would love to get some feedback on the ideas here.

Introducing WP Basis

Back in April I spoke at WordCamp Sheffield about Creating a Better WordPress Admin for Clients. The talk was mainly about customising the dashboard to make the experience better for clients, when editing and adding content. Since then I have managed to put into practice much of what I spoke about in to a new WordPress plugin – WP Basis.

WP Basis is a WordPress utility plugin that makes a number of changes to the WordPress dashboard (for your clients only) as well as providing a number of functions available for you to use when developing themes.

I thought the best way to break down what the plugin does was to put the main functions below and provide a link to the Github repository so that people can take a look at the plugin code itself.

WordPress Admin/Dashboard Modifications

As I have spoken about at WordCamps the WordPress dashboard can be a very complex environment for non-WordPress professionals. The WP Basis plugin attempts to simplify the admin screens for clients only, whilst keep the admin the same for experienced WordPress users.

The plugin adds a checkbox on the users profile page where the user can set themselves as a WP Basis Super User. This means the changes the plugin makes to the dashboard are not applied to these users. None WP Basis Super users get a simplified dashboard in the following ways:

  • Removal of a number of the WordPress menus to prevent clients from clicking or setting things that will effect the site. The Settings, Tools, Dashboard Page (see below), Plugins and Comments menus are removed.
  • Removal of some of the WordPress post meta boxes to clean up the post editing screen and prevent clients from adding meta boxes that could cause problems in the theme/site setup
  • Addition of a Site Options menu at the bottom of the admin menus. This site options page contains social media links, contact email for use on the site, telephone number of a WYSIWYG box to add footer content.

WordPress Custom Meta Boxes Framework

Included in the plugin is the Human Made WordPress Custom Meta Boxes plugin which allows developers to easily add custom meta boxes to the post editing screens in order to make adding custom fields much more user friendly.

Counter Functions

Styling posts can be made much easier with counter functions such as adding a “last class” CSS class to the last post within the WordPress loop. It also adds additional counting classes to widgets as well as WordPress menus.

Customised Dashboard Home Page

When a normal WordPress user logs in the plugin changes the admin landing page to include a more customised one. This is a great place for adding help, and additional adverts for your companies services. This page is split into tabs initially with just a welcome tab but the plugin is built (in many places) to be extensible and therefore you can easily add additional tabs to this screen using the filters and hooks available.

Post Type Descriptions

Having seen and used the excellent Post Type Descriptions Plugin from @stomptheweb I decided that it would be a good idea to include this in the plugin. It adds a description box to each post type which can then be outputted on the post type archive page.

Template Tags to Use in Your Themes

The plugin tries to give you the availability of a number of WordPress template tags which you can use in your sites themes and plugins. A few examples of the options are below:

  • wpbasis_content_nav() – this show the next and previous post links in a numbered format rather than just next/previous.
  • wpbasis_featured_img_url() – gets the post thumbnail or featured image url for a given featured image size.
  • wpbasis_get_blog_permalink() – return the page ID of at the page used for the sites blog posts or false it no page is being used.
  • wpbasis_get_current_url() – return the URL from the address bar of the current page
  • wpbasis_var_dump() – a more formatted version of the php var_dump() function

Amended Updating Capabilities

User which are not WP Basis super users have the capabilities for updating and adding plugins to WordPress removed, even if they are an administrator. This means that your clients cannot update WordPress with the potential to break something.

There are other things in the plugin but above is just a flavour of what the plugin does. Most of all I have tried to make this plugin as extensible as possible, outputting content using apply_filters to allow other plugins to change this content as well as allowing other plugins to add various content in places such as adding tabs to the dashboard screen or removing additional meta boxes using a filter.

The plugin is in the early stages and will no doubt evolve a lot more from here but any feedback is welcome. You can follow the evolution of the WP Basis plugin on Github. I am going to be making a beta release in the next week or so as there are only a few issues to fix. Watch this space!

Update – the plugin is not live on the WordPress plugin repository – http://wordpress.org/plugins/wpbasis/

The Lack of Consistency in WordPress Admin Display Hooks

Recently I have been working extensively on projects that involve working with customising the WordPress admin area to enable a better user experience. Perhaps the most notable example is working on the Edupress project with Rachel McCollin. During the course of working with amending the WordPress admin it has become apparent to me that there are a distinct lack of consistency in the admin hooks. Let me explain.

customized-edupress-admin

With the advent of theme frameworks a good few years ago now, developers have become very familiar with hooks, as well of course as those that exist in core that enable us to build on top of WordPress in the form of plugins. However a lot of the work developers do tends to be with the front end of WordPress in the form of themes. It was not until I started working extensively to convert the backend of WordPress that it became apparent there was a distinct lack of hooks and filters to work with, in terms of adding and removing content from the screen.

You can see from the screenshot above just what can be done in terms of customising the WordPress admin.

After working on the admin screens for Edupress I went ahead and created the Show Admin Display Hooks plugin, going through all the admin files in the wp-admin folder and looking for the available hooks. I was only concerned with the display hooks i.e. the ones that allow you to output content to the screen rather than the ones that enable you to add scripts and styles or functions etc.

The plugin outputs all the names of the hooks to the admin screens in the place where they are run, therefore you can see which hooks are available to work with.

It became apparent that there is a lack of consistency for developers in the hooks that they work with. Lets take a look at an example of what I mean. Below you can see two screenshots:

post-edit-admin-hooks

post-listing-admin-hooks

As you can see there are more hooks to play in the post editor screen. The problem here for me, is that all the admin screens have a page title in a h2 tag. Adding content below the title on the post edit screen can be done with the edit_form_top hook but there is no hook to do the same thing below the title on the post listing screen. Therefore a bit of consistency I believe would be helpful in this case. Therefore I would propose that a after_page_title hook is introduced on all admin screen after the page title is outputted. It seems that a before_page_title is not needed as the admin_notices and all_admin_notices hooks appear on every page.

Another hook that I would like to see added is a hook that fires directly after the “Add New” button on the post listing and post edit screen. This is a great place to add additional action buttons and would benefit from a hook. This could be something like add_new_h2 which is the name of the class given to the buttons in that area.

There is a need in the WordPress admin for plugin authors to be able to display a custom post type and associated taxonomies for that post type whilst only adding one menu item. If they add their post type under a sub menu that already exists such as Appearance, then taxonomies have to go in separately as you cannot have a third level menu. With an add_new_h2 hook, plugin authors could have links to the post types taxonomies in that place instead of an extra menu link.  This problem is outlined by Justin Tadlock with his Whistles plugin here, although Justin is suggesting a tabbed approach to solve the problem.

It is clear then that the WordPress admin does provide a number of action hooks for developer to output their own content in various places, however I think with a little more consistency on the hooks available as well as the addition of one or two additional hooks it would be much easier for developers.

View/Download Show Admin Display Hooks from Github

Remove Dashboard Menus for Specific Users

For a while now I have been using some simple code to remove the dashboard menus in WordPress, primarily so that clients can’t change certain settings and ‘break’ their sites. However the code I was using also removed those items for me too. This meant I had to memorise the admin URLs and visit them manually which is not ideal. Today I have managed to solve this problem by hiding WordPress dashboard menus for all except specified users.

The trick is to wrap your code around an if statement that first checks who the user is. The code I am using is below:

Basically the code grabs the current users user ID and then compares it to a list of allowed users. If is matches the function returns nothing, if it doesn’t match then it removes the specified menus in the WordPress admin areas.

In this example users with the ID 1 and 2 can see all menus, however the WordPress links menu will be removed for all other users. It is important to note that this code only removes the menus from view and doesn’t stop users from actually viewing these pages. If they know the URLs they will still load.