• Resolved sumanjung

    (@sumanjung)


    Hi there,

    I found the options to rewrite slug in permalink of custom post, It removes the slug but gives 404/Page not found error. Should i enter anything in Query Var or Custom query var slug fields? Also the other real pages turns in to 404 when i set ‘Query var: True’

    Here is the screenshot https://prnt.sc/tgutw9

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    It’s giving you a 404 page because WordPress no longer knows what to query for.

    I know I’ve seen tutorials in the past that have people replace that spot with a / and whatnot but it’s always been very hacky to me and not the best way to handle permalinks that still work but don’t have the slug value in it.

    That said, I know I have a post on the idea over at https://michaelbox.net/2020/06/slugless-post-type-permalinks/ which may help out more. It instead simply removes the slug from the permalink without changing the rewrite value, and then also amends the necessary queries to include the post type slug to also search for.

    Hopefully the post makes sense.

Viewing 1 replies (of 1 total)
  • The topic ‘Removing Slug from Custom Post’ is closed to new replies.