Title: Bug with custom post type
Last modified: August 19, 2016

---

# Bug with custom post type

 *  [Pierre_02](https://wordpress.org/support/users/pierre_02/)
 * (@pierre_02)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/)
 * Hi all,
 * i notice a bug with custom post type with emphasis (i use them, i’m french) and
   pagination.
    i’m currently developing a website where i use my own custom post
   type for accomodation/restaurant. So a user can select a type of accomodation/
   restaurant (eg : Hôtel, Restaurant, Camping, etc.) by clicking on a tag then 
   it can refine its choice by click on a tag of the town name (eg : Villers-Cotterêts).
   The problem is that, if the name of the town contains an emphasis when i click
   on “Next page” i got a 301 redirect and my emphasis caracters are removed during
   the redirection :(… So the name of town (Villers-Cotterêts) becomes “Villers-
   Cotterts” and no record is found…
 * Of course, i’ve tried to hard code the name of the town in my ‘meta_value’ and
   then, everything works fine. Despite the redirection, WP show me the next pages
   for the selected criteria.
 * In my code, i use a syntax with querystring to generate my url.
    example : [http://mywebsite.fr/commerce/type/restaurant/?ville=Villers-Cotter%C3%AAts](http://mywebsite.fr/commerce/type/restaurant/?ville=Villers-Cotter%C3%AAts)
   so the next page link (generated by the ‘next_posts_link’ function) will be [http://mywebsite.fr/commerce/type/restaurant/page/2/?ville=Villers-Cotter%C3%AAts](http://mywebsite.fr/commerce/type/restaurant/page/2/?ville=Villers-Cotter%C3%AAts)
   but if i click on it the WP redirect me (by a 301 error) to [http://mywebsite.fr/commerce/type/hotel/page/2/?ville=Villers-Cotterts](http://mywebsite.fr/commerce/type/hotel/page/2/?ville=Villers-Cotterts)(
   notice the removing of ê).
 * [EDIT]It seems that WP removes space in names too…[/EDIT]
 * Does someone have a solution/hack to bypass this ?
 * TIA.
 * Amicably,
 * Pierre.

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

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066472)
 * > It seems that WP removes space in names too.
 * It replaces them with a hyphen (-) IIRC. That’s all a part of URL sanitization.
   You can have your page title be what you want (Hôtel) but the PAGENAME would 
   be hotel (all lowercase, no accent mark).
 * You can see [http://core.trac.wordpress.org/ticket/9591](http://core.trac.wordpress.org/ticket/9591)
   for how messy this has been :/
 *  Thread Starter [Pierre_02](https://wordpress.org/support/users/pierre_02/)
 * (@pierre_02)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066474)
 * Hi Ipstenu,
    but it’s a parameter that i need to keep because i have to use it
   in my ‘meta_value’ parameter and that’s for what i used a querystring… It works
   when the url is not paginated. WP sanitize it only on pagination…
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066490)
 * You’ll notice how that trac ticket is still open? 🙂 Like I said, messy, and 
   it’s an ongoing issue. I would post about this problem there, because it’s very
   likely related.
 *  Thread Starter [Pierre_02](https://wordpress.org/support/users/pierre_02/)
 * (@pierre_02)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066574)
 * Thanks Ipstenu,
 * i’ll do it when i figured out how to do it 😉
 * Amicably,
 * Pierre
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066597)
 * Login with the same ID/password you use here 😀
 *  Thread Starter [Pierre_02](https://wordpress.org/support/users/pierre_02/)
 * (@pierre_02)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066609)
 * Thank Ipstenu,
 * done 😉
 * Amicably,
 * Pierre.

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

The topic ‘Bug with custom post type’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [next_posts_link](https://wordpress.org/support/topic-tag/next_posts_link/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 6 replies
 * 2 participants
 * Last reply from: [Pierre_02](https://wordpress.org/support/users/pierre_02/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/bug-with-custom-post-type/#post-2066609)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
