Change website URL without breaking links or images? WP 3.3

There is a helpful codex article about moving WordPress: http://codex.wordpress.org/Moving_WordPress. Basically, you need to find/replace the DB for instances of your old domain, and swap them with your new domain. One additional trick I’ve learned when moving WordPress between environments: since WordPress stores the domain in several places as serialized data in the DB, you … Read more

Define permalinks for custom post type by taxonomy in WP 3.4

Solution I have figured it out with the help of these posts by Jan Fabry -> https://wordpress.stackexchange.com/a/5478/10350 https://wordpress.stackexchange.com/a/22490/10350 I have set up the custom post type as follows -> Custom post type (register_post_type) -> “product” Taxonomy (register_taxonomy) -> “product-type” Back-end function I rewrite the permalink structure that is saved in the back-end, so that the … Read more

How to Remove Parents Category Permalink from Posts

With either str_replace or preg_replace, without either some naming conventions on the user end or some strong work in the method’s directives (linked, you can read about patterns here, ), you’re going to run into issues with the House | My House | New House scenarios; especially once you’re dealing with slugs, and if those … Read more