Managing url structure for your WordPress website or blog could be tedious especially when you have multiple post types.

Let’s learn this through following example.

Suppose we have 3 types of content in website i.e. Blog posts, services and news. For these, we want to create the following URL structures.
Blog Posts :[post-slug]
Services :[service-slug]
News :[news-slug]

For custom post types, we will be using the plugin “Custom Post Type UI

Setting permalink structure for default blog posts

  1. Go to “Settings” > “Permalinks”
  2. In “Common Settings”, select “Custom Structure” and input the following value
  3. Click on “Save Changes”
WordPress Default Posts Permalink structure

Setting permalink structure for custom post types

  1. Go to “CPT UI” > “Add/Edit Post Types”
  2. Open “Edit Post Types” tab and select the appropriate post type from the dropdown. In our case, it’s Services post type.
  3. Scroll down to “Settings” section and find the “Rewrite” field. This should be “True” for wordpress to enable rewrites.
  4. Update the “Custom Rewrite Slug” to the required path. So, we will update it to “service”.
  5. Set the “With Front” field to “False”.
    If you keep it True, then it will put the default permalink structure at front like[service-slug]. But we don’t want “blog” here.
WordPress Custom Post Type Permalink structure

You can set the custom url structure for other post types as well in the same way.