Remove custom taxonamy slug with pagination

One of the general problems after creating new custom post type or taxonomy is showing 404 page after accessing to new urls that are generated by your custom post type or taxonomy.

In many of cases, the problem is related to flush_rewrite_rules().
After creating new urls, you have to do flush rewrite rules to rewriting urls by WordPress.
If you don’t use it, you will get 404 when you access to them.

So we have several option to solve this:

1. Simple way:

You can simply go to setting -> permalinks section in admin dashboard and then (without change any settings) click save changes button.
With clicking save changes, WordPress core automatically call flush_rewrite_rules() in its process.
Now check your urls and they are working.

2. Professional way:

Based on best practices in WordPress, it is better that you define your custom taxonomy and post types inside plugins.

So the best place to flush_rewrite_rules() is when the plugin is activated.

Notice: Please notice that you only need it only the first time that you define it. It is mentioned also in WordPress developer documentation of register_post_type and also in this link:

ATTENTION: This is *only* done during plugin activation hook in this example!
 You should *NEVER EVER* do this on every page load!!

You can see the sample of this, in my plugin boilerplate in github.

Note: If you want only to check it, you can use it after registering your taxonomy (only one time) and then check urls (then you can remove it), but if you are creating plugin which is used by many people, you have to do it when your plugin is activated.

I hope your problem is related to this simple trick and this way solves you problem.