Archive | Snippets RSS feed for this section

Handle big/automated WXR exports with the WordPress CLI Exporter

If you run a big site or many blogs and would like to create some automated exports or run into memory/runtime issues with the web based exporter then this wrapper around the existing web-based WordPress exporter will likely help you out here. Grab the file from https://github.com/tott/WordPress-CLI-Exporter and copy it to your WordPress root folder […]

Continue reading

CLI based WordPress imports

I frequently need to import client content and I usually do it a couple of times so a CLI version of the importer is much more useful for me than the web interface. I guess many of you have the same issue so I published my current work in progress for a CLI wrapper around […]

Continue reading

Caching WordPress navigation menus – wp_nav_menu() wrapper

Navigation menus in WordPress are a great thing, sadly they are usually not performing very well and you might want to cache them. Here’s a small set of functions that allow you to cache the output of the navigation menus. Please note the inline comments in case your navigation menus have different layouts depending on […]

Continue reading

Caching get_posts()

get_posts() is a nice little function and is widely used within themes and plugins, but what most people don’t keep in mind is that there is at least one database query behind each of the calls. With taxonomy,category or meta queries it’s even more, so caching the result of this function can have quite an […]

Continue reading