Make WordPress Core

Opened 18 years ago

Closed 17 years ago

Last modified 5 years ago

#3202 closed enhancement (fixed)

"Redirect Old Slugs" should be in core.

Reported by: bryanveloso's profile bryanveloso Owned by: markjaquith's profile markjaquith
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: Administration Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

http://txfx.net/code/wordpress/redirect-old-slugs/

Simply, this should be in core, there's no reason why any WP installation should be without this.

Attachments (1)

redirect-old-slugs.diff (4.7 KB) - added by markjaquith 18 years ago.
Patch for /trunk/

Download all attachments as: .zip

Change History (12)

#1 @markjaquith
18 years ago

  • Status changed from new to assigned

You're just saying that because I have commit access. :-P

Okay, I can't lie. It's a brilliant plugin, and you're right.

@markjaquith
18 years ago

Patch for /trunk/

#2 @markjaquith
18 years ago

  • Keywords has-patch 2nd-opinion added

Patch is up.

  • New meta key (_wp_old_slug) which will be hidden (it should just WORK without people even seeing it)
  • People who were using the plugin will have their old slugs updated to the new meta key on upgrade
  • uses wp_redirect($link, '301') now
  • Only works on posts. There doesn't seem to be a clean way of recognizing failed Page attempts... of course there is always my "Page Links To" plugin to take care of that. ;-)
  • Works completely through filters.

I'm obviously biased, so I'm going to need some +1's here

#3 @Viper007Bond
18 years ago

Gets my vote. Helps the noobs and people like me who can't spell. :)

#4 @bryanveloso
18 years ago

Yea, why isn't that one in core either? :P

#5 @matt
17 years ago

+1, go for it.

#6 @JeremyVisser
17 years ago

If you're going to commit this, can you also make the slug automatically update to reflect the post title when the post title is changed? I believe the reason the slug wasn't updated to reflect an updated post title was to not break links, but if this is committed, that won't be an issue.

#7 @markjaquith
17 years ago

JeremyVisser,

Hm, probably not a great idea. It'd cause a lot of unnecessary redirects. Take for instance the rather common practice of updating "Post Title" to "Post Title (UPDATED!)" ... that shouldn't cause a slug change, because, well, it doesn't make sense to have "updated" in the slug, it'll break caching, and it could cause the link to lose a bit of Google juice.

#8 @markjaquith
17 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4556]) Remember old post slugs and automatically redirect to the new slug. fixes #3202

#9 @ryan
17 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I see this when updating the slug on a published post.

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/weblog/wp-admin/admin-functions.php on line 2094

#10 @markjaquith
17 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4571]) cast to array when checking for old post slugs. fixes #3202

This ticket was mentioned in Slack in #community-team by iandunn. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.