Title: [Plugin: Custom Permalinks] Fixed a bug
Last modified: August 20, 2016

---

# [Plugin: Custom Permalinks] Fixed a bug

 *  [koneu](https://wordpress.org/support/users/koneu/)
 * (@koneu)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-permalinks-fixed-a-bug/)
 * I just discovered your very useful plug-in and wanted to put it into a site we’re
   currently readying for production. Alas, I found a little bug that hits when 
   the site is using a non-default table prefix.
 * In the Query (on about line 165) you reference the `wp_posts` table directly,
   as opposed to using `$wpdb->posts`. This means that for our site, we always hit
   404, without an error explanation. Applying the fix solved it, so we can now 
   have the site up and running soon!
 * [http://wordpress.org/extend/plugins/custom-permalinks/](http://wordpress.org/extend/plugins/custom-permalinks/)

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

 *  [dgeri](https://wordpress.org/support/users/dgeri/)
 * (@dgeri)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-permalinks-fixed-a-bug/#post-2480166)
 * I can’t even tell you how much you saved my life, koneu.
 * I changed:
    `" wp_posts.post_status = 'publish' AND ".` to `" $wpdb->posts.post_status
   = 'publish' AND ".`
 * SAVED MY LIFE. THANK YOU!
 *  [travxrose](https://wordpress.org/support/users/travxrose/)
 * (@travxrose)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-permalinks-fixed-a-bug/#post-2480254)
 * Hey guys,
 * I’m having the same 404 issue without fail. I’ve searched for the phrase your
   referencing and I can find it. I’m looking in the file custom-permalinks.php…
   Is that not where I should be looking?

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

The topic ‘[Plugin: Custom Permalinks] Fixed a bug’ is closed to new replies.

 * ![](https://ps.w.org/custom-permalinks/assets/icon.svg?rev=1785367)
 * [Custom Permalinks](https://wordpress.org/plugins/custom-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-permalinks/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [travxrose](https://wordpress.org/support/users/travxrose/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-permalinks-fixed-a-bug/#post-2480254)
 * Status: not resolved