Handle category name URL rewrite before different post type slugs

After some brainstorming and a lot of trial and error with T5 Rewrite and HM Rewrite, I went for the simplest possible solution. The permalink was actually intercepted by WordPress so I didn’t need the additional rewrite rule (even though it didn’t hurt, other than performance). I left %category%/%post_id%/%postname% as the default custom permalink, and … Read more

Custom post type by ID in root folder

Try creating a custom rewrite rule and a custom rewrite tag. This should allow you to set up a regular expression to capture the ID and manipulate the query. Rewrite API/add rewrite rule « WordPress Codex https://goo.gl/kdEJd8 Rewrite API/add rewrite tag « WordPress Codex https://goo.gl/PVLzLh

Deleted Page Still In WordPress Database

There is a function that is looking for duplicated post names: wp_unique_post_slug. In this function are few queries, and one of them is looking for duplicated post names: SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1. If this query will return some rows then function … Read more

Broken wordpress permalinks on pages only

Do you have a custom post type? This is exactly the kind of behavior you will see from have a custom post type with a slug that matches the slug of your pages. For example, if you have a page called “portfolio” and a post type called “portfolio”, both with a slug of “portfolio”, 404s … Read more

URL Rewrite + Page + Custom Post Type = Unusual Redirect

You should try setting ‘slug’ ( in the ‘rewrite’ parameter/option) to ‘our-firm/shareholders’, just like the structure you have set in the add_rewrite_rule() function. The first parameter of add_rewrite_rule() and the ‘rewrite’ setting of the custom post type must be equal in order to get the rewritting actually working. So, in case you choose coding the … Read more