Adding categories to custom post type in permalink

There are 2 points of attack to cover when you are adding custom post type rewrite rules: Rewrite rules This happens when the rewrite rules are being generated in wp-includes/rewrite.php in WP_Rewrite::rewrite_rules(). WordPress allows you to filter the rewrite rules for specific elements like posts, pages and various types of archive. Where you see posttype_rewrite_rules … Read more

WordPress and Woocommerce Chinese Permalink

Turns out this was caused by IIS. If you already have <action type=”Rewrite” url=”index.php” /> in your web.config, that should be enough with this addition to your index.php in the WordPress root installation directory if (isset($_SERVER[‘UNENCODED_URL’])) { $_SERVER[‘REQUEST_URI’] = $_SERVER[‘UNENCODED_URL’]; } The php code is quite self explanatory.

Bulk update set of URLs via SQL

OK, so let’s assume you have these URLs in some array (if you don’t, you can easily prepare it using any developer text editor, I guess). Let’s call that array $slugs and let’s say it’s defined like so: $slugs = array( ‘customer-name’ => ‘google-customer-name’, … ); So there are only slugs in there. So now … Read more