| 0161 465 3302

Bamboo Migration does what it says on the plugin.

A week ago we released Bamboo Migration, our eighth plugin for WordPress. This plugin is a bit of a departure from the type we normally release, in that it’s of more use to developers than users.

In keeping with our usual ethos for creating plugins, Bamboo Migration  does one thing, and does it as  simply as possible – it makes moving a WordPress site from one domain to another really easy. It does this by generating a custom .sql export file of the entire WordPress database, with all references to the old domain name replaced with the new one.

A nice surprise side effect of releasing a plugin for developers is that it attracts more attention than a normal plugin. In this instance the plugin has been listed by Web Designer Depot in  ‘The Best Free WordPress Plugins For November 2014‘. While we don’t normally chase accolades and awards (its just not what we’re about), we’re really chuffed when somebody finds one of our plugins useful.

We’re planning to release our ninth plugin before Christmas, and I’m sure we won’t be too far into 2015 before our tenth one sees the light of day. We just hope that the WordPress community find them as useful as our other plugins.

Taxonomies vs permalinks.

If you are creating custom taxonomies in WordPress, either as part of a theme or a plugin, you may encounter 404 errors when navigating those taxonomies on your website.

What on earth
is going on?

It generally only occurs if you are using the taxonomy within your permalinks, i.e. if your permalinks are set to something like this:


At first glance everything will seem to be OK, until you navigate to page 2  of the archive page in question. At this point WordPress will send the browser to a URL looking something like this:


The appended ‘/page/2’ will conflict with the custom permalink setting, resulting in an a 404 error.

Don’t give me problems,
give me solutions.

We need to achieve two things to solve this problem. Firstly we need to remove the offending parts of the URL before WordPress tries to process the URL. Adding the following code to your functions.php (or as part of your initialisation code if you are a plugin author) will do just that:

function bamboo_request($query_string )
    if( isset( $query_string['page'] ) ) {
        if( ''!=$query_string['page'] ) {
            if( isset( $query_string['name'] ) ) {
                unset( $query_string['name'] );
    return $query_string;
add_filter('request', 'bamboo_request');

Yeah but
what about the paging?

Assuming you would still like to have paging for your custom taxonomy, the follow code will take the page number from the URL and append it to the WordPress query in the required format. Again the follow code should be added to your functions.php or your plugin initialisation code:

function bamboo_pre_get_posts( $query ) { 
    if( $query->is_main_query() && !$query->is_feed() && !is_admin() ) { 
        $query->set( 'paged', str_replace( '/', '', get_query_var( 'page' ) ) ); 

That’s great but
do I really have to do all that?

If you don’t like the idea of writing all that code, or you’re just feeling a bit lazy, there is also a plugin available to fix this problem automatically available here: http://wordpress.org/support/view/plugin-reviews/category-pagination-fix (but where would the fun in that be!).