• I have been messing around with some plugins that recycle old posts. They all seem basically the same, but their functionality seems limited to changing the publication date to the current date and displaying the post as the most recent item. That is great, but I need more. I need the URL changed as well.

    • This topic was modified 3 years, 1 month ago by PayDelete.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    In changing the URL, you mean just changing the post’s URL slug in its permalink, right? Changing anything else in the permalink gets much more involved. The slug can be changed by getting the post object and changing its “post_name” property, then sending the altered post object to wp_update_post(). The date change plugins likely do the same thing with the post’s date properties. Such a plugin could likely be altered to also change the “post_name” property as well.

    Ideally, the plugin would offer some sort of filter hook so you can alter post data without having to directly alter plugin code.

    One question would be how would this code know what to change the slug to? Automatically appending something like “-updated” is easy enough. If it has to be user specified for each post, you may as well manually alter the slugs through the post’s normal quick edit process.

    Thread Starter PayDelete

    (@paydelete)

    @bcworkz thanks for the reply. I know there are ways to change the post_name using update post, but I am hoping to find that in a plugin without having to build a new plugin myself.

    Moderator bcworkz

    (@bcworkz)

    Understood. It didn’t look like you were getting any such suggestions. If you examined the source code of an existing plugin that you otherwise like, perhaps there’d be a useful hook to use to modify the data used to update an old post.

    You could simply modify the plugin directly. The modifications would be lost when the plugin is updated, but reapplying them may be easier than building your own plugin. Some plugins are rarely updated anyway.

    This topic remains open if anyone should have a plugin suggestion that does this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need Re-Publish Plugin That Changes Permalinks’ is closed to new replies.