Title: [Plugin: Polylang] 404 errors with /%postname%/ permalinks
Last modified: August 20, 2016

---

# [Plugin: Polylang] 404 errors with /%postname%/ permalinks

 *  [fake946](https://wordpress.org/support/users/fake946/)
 * (@fake946)
 * [14 years ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/)
 * Hello,
 * I’m using Polylang v0.8.5.
    When I use the default permalink type “[http://localhost/wp2/?p=123&#8221](http://localhost/wp2/?p=123&#8221);,
   everything works fine. (Thank you for your work, btw.)
 * But when I switch to the permalink type “[http://localhost/wp2/example-article/&#8221](http://localhost/wp2/example-article/&#8221);,(
   [http://localhost/wp2/%postname%/](http://localhost/wp2/%postname%/)) I keep 
   getting 404 errors.
 * What am I doing wrong ?
 * Thank you in advance for your answer,
 * [http://wordpress.org/extend/plugins/polylang/](http://wordpress.org/extend/plugins/polylang/)

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/page/2/?output_format=md)

 *  [danielboros](https://wordpress.org/support/users/danielboros/)
 * (@danielboros)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746868)
 * Hello Chouby,
 * I have this problem with custom posts.
    I too have /%postname%/ permalinks. I’m
   getting 404 errors on all custom post type pages.
 * For example, I have a custom post type called ‘wallpapers’, with a post called‘
   time-machine’, but /wallpapers/time-machine/ throws a 404 error.
 * WordPress itself does have a [similar problem](http://wordpress.org/support/topic/permalinks-404-with-custom-post-type),
   but none of those solutions worked for me..
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746871)
 * Did you flush your rewrite rules ? (Settings-> permalinks : click on save changes).
 * The normal url for an English post would be: /en/wallpapers/time-machine/ (except
   if English is the default language and you chose to hide the language code for
   it ?)
 *  [danielboros](https://wordpress.org/support/users/danielboros/)
 * (@danielboros)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746872)
 * Yes I’ve tried re-saving it a few times.
 * However I _do_ hide the language code – i give different names to all my posts
   and pages in different languages. This might not be a good idea but it seemed
   to work out fine up to this point..
 * Thank you,
    Dabiel
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746873)
 * I wrote something wrong about the url. The language code is added only if the
   option “Add language information to all URL including posts, pages, categories
   and post tags” is checked.
 * Yes, this is a limitation of the way Polylang works. You must have different 
   names (or more exactly different slugs) for all posts and pages in different 
   languages.
 * Do you register the post type yourself or do you use a plugin ?
 *  [danielboros](https://wordpress.org/support/users/danielboros/)
 * (@danielboros)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746876)
 * I am keeping all my slugs different. I’d like to avoid adding language information
   to the url.
 * I’ve registered my post types manually. Here’s my code:
 *     ```
       register_post_type('wallpapers', array(
           'label' => __('Wallpapers'),
           'singular_label' => __('Wallpaper'),
           'public' => true,
       	'_builtin' => false,
           'show_ui' => true,
           'capability_type' => 'post',
           'hierarchical' => false,
           'query_var' => false,
           'supports' => array('title', 'editor', 'trackbacks', 'custom-fields', 'thumbnail', 'comments'),
           'rewrite' => array('slug' => 'wallpapers')
       	));
       ```
   
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746879)
 * I copied pasted the above code in a function hooked to the init action. I don’t
   get a 404 error but another bug (the language of the theme is always set to default
   whatever the language of the custom post type). The problem is linked to the 
   line:
 *     ```
       'query_var' => false,
       ```
   
 * which breaks the Polylang rewrite rules. Is there a specific reason for you not
   to set it to true ? Could you tell me if setting it to true (and then refresh
   your rewrite rules) solves your problem ?
 * On my side, I will have to further look at this parameter and examine its consequences
   on rewrite rules.
 *  [danielboros](https://wordpress.org/support/users/danielboros/)
 * (@danielboros)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746880)
 * You are my hero. I don’t know why I included the query_var, I guess I just copied
   it over from some sample code, while trying make things work..
 * Anyway, I’ve simplified my function and now it works like a charm:
 *     ```
       register_post_type('wallpapers', array(
           'label' => __('Wallpapers'),
           'singular_label' => __('Wallpaper'),
           'public' => true,
       	'_builtin' => false,
           'supports' => array('title', 'editor', 'trackbacks', 'custom-fields', 'thumbnail', 'comments')
       	));
       ```
   
 * I think I owe you a beer or two.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746883)
 * Great. On my side, I found the reason for the bug. I will correct it with the
   next release.
 *  [Mr_Scientist](https://wordpress.org/support/users/mr_scientist/)
 * (@mr_scientist)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746922)
 * Hi all,
 * This is a problem that I’m still encountering.
 * The site I work on has a number of different parent > child categories across
   two languages. The URL structure I’m using is the ‘postname’ option. When categories
   are either edited or added the whole site gets 404s. At the moment I have to 
   go to the permalinks setting screen and manually flush the rewrites rules. This
   isn’t too bad when it comes to myself doing it, but for the other users is more
   complicated.
 * Is there an elegant solution out there to this problem?
 * I’m using Polylang v 0.9.2
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746923)
 * Never got such problem. Did you test for a plugin or theme conflict? Does the
   problem occur only with %postname% permalink structure?
 *  [Mr_Scientist](https://wordpress.org/support/users/mr_scientist/)
 * (@mr_scientist)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746924)
 * Yes, it does only seem to occur when the permalinks are on. As for conflicts,
   this I’m unsure of, although I do know that the theme I’m developing on is available
   for translation.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746926)
 * You should test first with WP + Polylang + Twenty Ten and then swithc your theme
   and add other plugins one by one to detect if there is a conflict.
 *  [RRikesh](https://wordpress.org/support/users/rrikesh/)
 * (@rrikesh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746927)
 * If that may help, I got a similar problem some weeks back.
 * I created a fresh .htaccess file ([from this page of the Codex)](http://codex.wordpress.org/Using_Permalinks)
   and saved my permalinks again. It solved my issues.
 * Don’t forget to backup your .htaccess before 🙂
 *  [holafandango](https://wordpress.org/support/users/holafandango/)
 * (@holafandango)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746928)
 * Sorry for start a new chat… I have the same problem, all the entries, pages… 
   goes to 404.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/#post-2746929)
 * Did you try what has been suggested above?
    - Resave your permalinks first.
    - make test with WP + Polylang + Twenty Ten and then switch your theme and add
      other plugins one by one to detect if there is a conflict

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/page/2/?output_format=md)

The topic ‘[Plugin: Polylang] 404 errors with /%postname%/ permalinks’ is closed
to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 22 replies
 * 9 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-polylang-404-errors-with-postname-permalinks/page/2/#post-2746962)
 * Status: not resolved