WordPress.org

Ready to get started?Download WordPress

Forums

Remove slug from custom post type
Remove slug for just one custom post type (10 posts)

  1. publicradio
    Member
    Posted 1 year ago #

    I like the plugin, but I have three different custom post types registered and I only need the slug removed for one of them. Is there a way to do this?

    http://wordpress.org/extend/plugins/remove-slug-from-custom-post-type/

  2. mitchmcc
    Member
    Posted 12 months ago #

    I like the plugin as well. I am also looking for an option that allows me to select which custom post type the slug is removed from.

  3. netjmt
    Member
    Posted 12 months ago #

    The idea is good. And just for the record, I installed the plugin on my 3.5.2 wp site, and it worked good. But after I disabled the plugin, the custom post type's slugs are still removed. I tried resetting permalinks but still nothing. It seems the plugin modifies the site permanently even if the plugin is disabled afterwards. :(

  4. jennybeaumont
    Member
    Posted 11 months ago #

    would be curious about this too - not only about the possibility to single out certain CPTs, but also the question of whether the plugin makes permanent changes, and/or how to recover the slugs should we change our minds...

    is this plugin still supported?
    cheers!
    -jennyb

  5. netjmt
    Member
    Posted 11 months ago #

    Hello Jenny and everybody, I just found out that the plugin adds some lines to the .httaccess, so that's why it works even after the plugin is disabled. Just access this file from your ftp (or get a plugin to edit it).

    # BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
    RewriteRule ^sk_igallery/(.+)/$ /$1 [R=301,L]
    RewriteRule ^gallery/(.+)/$ /$1 [R=301,L]
    RewriteRule ^video/(.+)/$ /$1 [R=301,L]
    RewriteRule ^project/(.+)/$ /$1 [R=301,L]
    # END REMOVE SLUG CUSTOM POST TYPE RULES

  6. jennybeaumont
    Member
    Posted 11 months ago #

    Thanks for the info netjmt!

  7. davejuk
    Member
    Posted 10 months ago #

    I also need to remove the slug from just a single custom post type.

    Unfortunately I am not proficient enough with PHP to be able to make the required changes myself.

  8. davejuk
    Member
    Posted 10 months ago #

    OK, so I had a go at modifying the plugin to do what we want (see pastebin URL below). I have added a set of checkboxes that allow you to select the custom post types you want to apply it to. These are then saved as a custom option and loaded again when the options page is viewed. However I cannot figure out how to proceed from here.

    I guess it just needs to selectively apply the various filters according to which custom post types have been selected but this is beyond me at this point. Can anyone with a bit more experience pick it up and run with it?

    http://pastebin.com/zzZdSkZT

  9. iamnix
    Member
    Posted 10 months ago #

    I came here wondering if anyone could help me with static homepage being forcibly disabled by this plugin. But doesn't seem much helpful.

    Anyway, those wanting it on per-post basis, should try another plugin I used before knowing this one - wordpress.org/plugins/custom-permalinks

  10. davejuk
    Member
    Posted 10 months ago #

    iamnix: We want to apply it to certain Custom Post Types, not individual posts. Why would you only want to apply it to certain posts? This is plugin is all about making a clean and consistent URL structure; removing the slug from individual posts would make URLs inconsistent and confusing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.