Title: Url changes to ?post_type=
Last modified: August 10, 2019

---

# Url changes to ?post_type=

 *  Resolved [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/url-changes-to-post_type/)
 * Hi,
 * I have a page _[ redundant link removed ]_ that for some reasons automatically
   redirects to a url with `?post_type=`.
 * The id matches a product-set with the name “Limabønner”, so I suspect that the/
   lima/ matches the beginning of the product-set name and that’s the cause of the
   redirect.
 * But why is this happening and is there a way to override/stop it?
 * I have other /b/ pages that works fine, for example /b/bodylab/. Probably because
   there are no WP content that starts with the name “Bodylab”.
 * The /b/ pages are a way for my site to display content from a database, i.e. 
   they are not part of the normal WP posts/pages.
 * Thanks,
    Mads
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Furl-changes-to-post_type%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/url-changes-to-post_type/#post-11819593)
 * I have tried to do add_action() for `init` and `wp_loaded` – in both cases, the
   url is still `/b/lima/`, i.e. the url/redirect to `?post_type=` happens after
   those two actions.
 * Here’s exactly how it goes:
 *     ```
       init - url is /b/lima
       wp_loaded - url is /b/lima
       init - url is now ?post_type :(
       wp_loaded - url is ?post_type
       template_redirect - url is ?post_type
       ```
   
 * Note that template_redirect is never reached when the url is `/b/lima`.
    -  This reply was modified 6 years, 10 months ago by [Mads Phikamphon](https://wordpress.org/support/users/madsphi/).
    -  This reply was modified 6 years, 10 months ago by [Mads Phikamphon](https://wordpress.org/support/users/madsphi/).
 *  Thread Starter [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/url-changes-to-post_type/#post-11819610)
 * Solution found, just add this to the code:
    `http://biostall.com/prevent-wordpress-
   redirecting-to-nearest-matching-url/`
 * Thanks for the hint to

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Url changes to ?post_type=’ is closed to new replies.

## Tags

 * [post_type](https://wordpress.org/support/topic-tag/post_type/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/url-changes-to-post_type/#post-11819610)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
