Opened 9 years ago
Closed 4 years ago
#35352 closed defect (bug) (wontfix)
URL / Slug does not get updated when title is changed
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4.1 |
Component: | Permalinks | Keywords: | reporter-feedback close |
Focuses: | administration | Cc: |
Description
BUG IMO:
- create a post in WP and insert it's title
- Slug / URL is created
- Edit the title
–> Slug does not change / Update –> Slug does not change either
Attachments (2)
Change History (14)
#2
@
9 years ago
Right - agree. but this is just one scenario imagine this (actually how I came across this):
- News site author is writing a long post and gives it a title
- While editing the content the author decides to change the title because some important keywords he just added seems better than the original title
- Author publishes the post
Now autor has a URL different than the title and that hasn't got the best slug.
#3
@
9 years ago
- Component changed from General to Permalinks
- Keywords reporter-feedback added; 2nd-opinion removed
While a post is unpublished (eg. in draft), the post slug changes whenever the title is changed and the post is saved. Only once the post is published does the slug become fixed.
@webifish Are you seeing different behaviour?
#4
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
While a post is unpublished (eg. in draft), the post slug changes whenever the title is changed and the post is saved. Only once the post is published does the slug become fixed.
I can confirm this behaviour on a clean install of trunk and WordPress 4.7.
#5
follow-up:
↓ 7
@
8 years ago
@webifish
Same behaviour on a clean install of WP 4.7.3 on local dev, on a already published post. When the post title is changed and updated, the permalink will not be updated to match the new post title.
#6
@
8 years ago
- Keywords needs-patch added; close removed
- Resolution worksforme deleted
- Status changed from closed to reopened
#7
in reply to:
↑ 5
@
8 years ago
- Keywords close added; needs-patch removed
Replying to lukecavanagh:
Same behaviour on a clean install of WP 4.7.3 on local dev, on a already published post.
Published posts have a fixed slug unless it's explicitly edited manually, see comment:3.
#8
follow-up:
↓ 10
@
8 years ago
@SergeyBiryukov
Why does a published post slug have to be fixed though?
#9
@
8 years ago
@SergeyBiryukov
I was able to find this method.
http://wordpress.stackexchange.com/questions/135931/reslug-a-custom-post-type/136099#136099
Forked updated version of the re-slug plugin
https://github.com/lukecav/re-slug
https://wordpress.org/plugins/re-slug/
Works in WP 4.7.3 on local dev, so if you edit the post name, then hit the re-slug button next to Edit near the slug metabox, it will update the slug to match the post name before post save.
#10
in reply to:
↑ 8
@
8 years ago
Replying to lukecavanagh:
Why does a published post slug have to be fixed though?
To avoid breaking existing links?
Posts can redirect from old slugs, but pages cannot (see #4328), so it's good to have that extra step to make sure the slugs for any published content are only changed when intended.
#12
@
4 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from reopened to closed
An updated post title of a published post does not change the slug on purpose. Why? To avoid 404s when the original URL is made. If the post slug needs to be updated, it can be done manually. But then the original slug and its URL will need to be considered too, ie possibly adding a redirect to point it to the new slug.
I'm closing this ticket as the behavior is as expected and it's been over 4 years since it was marked for close
.
Once the url is generated the first time, the url will not change with title changes later.
This is functioning as expected if I understand the ticket.
Hypothetical situation:
To change the url, it can be done manually by using the "Edit" button next to the permalink