[wp-trac] [WordPress Trac] #34136: Allow register_post_type's rewrite to remove CPT slug
WordPress Trac
noreply at wordpress.org
Wed Aug 28 20:10:19 UTC 2019
#34136: Allow register_post_type's rewrite to remove CPT slug
---------------------------+------------------------------
Reporter: BenRacicot | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version: 4.3.1
Severity: normal | Resolution:
Keywords: | Focuses:
---------------------------+------------------------------
Comment (by kwalsh.ucnj@…):
Replying to [comment:2 michael.ecklund]:
> @BenRacicot Could you include a reason or reasons why this would be
beneficial to the community?
What about advertisement "vanity URLs"? For example --
oursite.com/instagrammer or oursite.com/youtuber or oursite.com/podcaster.
I think this kind of a set-up/URL scheme is fairly standard these days
with podcast and YouTube advertising.
These forms of advertisement are areas where an extremely short, memorable
URL is beneficial. For example, podcasts -- when a URL is read out loud,
it needs to be dead simple. Otherwise people will not remember it. For
another example, YouTube/Instagram posts -- adding the URL into the
image/video. Again, needs to be dead simple. Otherwise people will not re-
type it correctly.
In my typical implementation of the "Vanity URL" WordPress CPT, there's
usually a URL input so the site editor can add a third-party input URL.
There's some template_redirect logic to redirect from the dead simple URL
to the input URL. This third-party input URL either detects mobile OS and
redirects the user to the App/Play store, or has some kind of analytics
for install attribution. Without custom, unique vanity URLs for each
outreach area -- there's no way to measure how much traffic is coming from
these sources. And nobody likes advertising without knowing about the
return. It is also different behavior from pages -- there's not even a
front end template, as the URL is just a redirect.
In these cases, an extra directory in the URL kills the idea of URL
simplicity. Even the "best case" solution now, having /v/ ahead of the
unique part of the URL... I would bet money there are people who do not
remember to type the /v/ portion of the URL. So we currently are prevented
from adding vanity URLs via a WordPress custom post type, because we
cannot completely remove the custom post type slug from the URL.
In addition -- in our case, we are currently working with at least 10
different ad sources that "require" (work best with) different short,
memorable vanity URLs. It may work for some sites to mix vanity URLs in
with pages... but when you get past the point of a couple vanity URLs and
a couple pages, I think it quickly becomes difficult to manage in the back
end.
I hope this is OK to respond. Never done this before. Just trying to put
out what I think is a solid use case for no-CPT slug CPTs. Thanks for your
time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34136#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list