Title: Changing the default WordPress permalink settings
Last modified: March 9, 2020

---

# Changing the default WordPress permalink settings

 *  Resolved [pkremer](https://wordpress.org/support/users/pkremer/)
 * (@pkremer)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/)
 * If I have this plugin activated, and I change the standard WordPress permalink
   setting from “Month and Name” to “Post Name”, will the plugin automatically redirect
   all of the existing month and name permalinks?
 * The goal is to have all future permalinks follow the post name structure, yet
   retain all of the existing month and name permalinks.
 * If the plugin can do this out of the box it’s worth the $50 in time savings alone
   even if I don’t need pro.

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/page/2/?output_format=md)

 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12525176)
 * Hi [@pkremer](https://wordpress.org/support/users/pkremer/),
 * You do not need paid version to accomplish this 🙂 If you would like to make 
   sure that the old (native) permalinks redirect to new ones, you should:
    - keep the original settings (“Month and Name”) intact in “**Settings -> Permalinks**“
    - change the permalink format for posts to “%postname%” in Permastructures section(“**
      Tools -> Permalink Manager -> Permastructures**“)
 * Please let me know if you need any further assistance.
 * Best regards,
    Maciej
 *  Thread Starter [pkremer](https://wordpress.org/support/users/pkremer/)
 * (@pkremer)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12525418)
 * I guess I forgot to explain one little issue – when you keep Settings->Permalinks
   set as “Month and Name”, and you update the posted date on a post, the permalink
   changes.
 * So if we have foo.com/2019/12/mypost, then I update it today, I end up with foo.
   com/2020/03/mypost
 * I don’t want the permalink to change when I updated the post date, which is why
   I wanted to change the setting in WordPress. The desired behavior is that any
   link that ever existed for this post still continues to work. Does the plugin
   function in this fashion?
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12525480)
 * Ok, I see.
 * Then you need to use save the old permalinks as custom permalinks. Please do 
   the following:
    - Keep the original permalinks settings intact (“Settings -> Permalinks“)
    - Go to “Tools -> Permalink Manaager -> Tools -> Regenerate/reset” section and
      regenerate posts permalinks (this would save them as custom permalinks, so
      they will not be later auto-updated)
    - Change the permalink format for posts to “%postname%” in Permastructures section(“
      Tools -> Permalink Manager -> Permastructures“)
    - The new permalink format will be applied only to new posts
 * Best regards,
    Maciej
    -  This reply was modified 6 years, 3 months ago by [Maciej Bis](https://wordpress.org/support/users/mbis/).
    -  This reply was modified 6 years, 3 months ago by [Maciej Bis](https://wordpress.org/support/users/mbis/).
 *  Thread Starter [pkremer](https://wordpress.org/support/users/pkremer/)
 * (@pkremer)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12525574)
 * Using ‘Use original URLs as custom permalinks’ option?
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12525579)
 * Yes, exactly.
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12527174)
 * Hi [@pkremer](https://wordpress.org/support/users/pkremer/),
 * Did you manage to adjust the custom permalink settings? Please let me know if
   you need any further assistance.
 * Best regards,
    Maciej
 *  Thread Starter [pkremer](https://wordpress.org/support/users/pkremer/)
 * (@pkremer)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12529481)
 * The regenerate option did save the original permalinks, and I made the rest of
   the changes as shown. However, when I update the post date on an old post to 
   today, it breaks again by putting the new date in the permalink. Then I have 
   to manually put the old permalink back into the redirect table. But at least 
   that part works.
 * I still wonder what will happen if, now that I have the redirect table populated,
   I set wordpress to default to postname.
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12529497)
 * Hi [@pkremer](https://wordpress.org/support/users/pkremer/),
 * The custom permalinks should not be changed if you set “Auto-update the URI” 
   mode to “No” even if you change the post date.
 * I am not certain what do you mean by “redirect table”.
 *  Thread Starter [pkremer](https://wordpress.org/support/users/pkremer/)
 * (@pkremer)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12529941)
 * That setting was the problem, I didn’t set the auto-update to ‘no’. Now it works.
   Thanks!
 *  [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12575917)
 * Hi, I got the same request, only my old posts got the format of ugly urls. May
   be I need a pro version?
    I got old posts with the ?p=409 format, but need the
   future posts to be word based urls. Could you please help? Thank you.
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12575978)
 * Hi [@signale](https://wordpress.org/support/users/signale/),
 * If you would like to keep old format for old posts, you do not need to use my
   plugin. There is a simpler way to preserve the old format and use the posts slugs
   in new permalinks.
    1. Please paste the below code snippet to functions.php file in your (child) theme
       directory
    2. Please change the date inside the code (2020-02-15) to different one. All old
       posts will keep the old format (“Plain”) ?p=ID, the new ones will use the new
       format (“Post name”).
    3. Please change the permalink settings in “Settings -> Permalinks” from “Plain”
       to “Post name”
 *     ```
       function bis_post_permalinks($permalink, $post) {
       	if(!empty($post->post_type) && $post->post_type == 'post') {
       		// Old format
       		if(strtotime($post->post_date) < strtotime('2020-02-15')) {
       			$permalink = add_query_arg('p', $post->ID, get_home_url());
       		}
       	}
   
       	return $permalink;
       }
       add_filter('post_link', 'bis_post_permalinks', 9999, 2);
       ```
   
 * Best regards,
    Maciej
    -  This reply was modified 6 years, 2 months ago by [Maciej Bis](https://wordpress.org/support/users/mbis/).
 *  [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12576012)
 * Thanks a lot for the reply. Though I got custom permalinks for the new posts 
   too.
    The site in question is: [https://aristake.com](https://aristake.com) Here
   are all the posts: [https://aristake.com/?post=all#sort=newestFirst&filter=AllTopics](https://aristake.com/?post=all#sort=newestFirst&filter=AllTopics)
   And posts at the bottom they got pretty urls, but redirect to ugly ones (with
   the changed query tag). Besides urls are not connected to the post’s names – 
   it’s custom. I’ve managed to achieve this pretty urls, then set redirection so
   that old posts redirect into /?p=304 (later will check query tag) The client 
   needs precise urls cause of AddThis transfer. I’ve contacted to the AddThis support
   and they said now the url must match 100% so to get counters as social services
   changed their API and now even http and https count separately. And everything
   falls into its places except for the AddThis gets the url not from the actual
   page, but from the permalink setting! And it’s killing me as managed to configure
   everything so perfect. Is there a way to give to this AddThis plugin another 
   permalink just for the single post area? I mean only when it’s ugly permalink
   redirect detected then to give it another permalink. I’ve heard there are ways
   to have a few permalinks. Even the fact that the post opens on ugly url says 
   it’s possible. The only thing left is to transfer the proper permalink info when
   it’s on the ugly version.
 *  [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12576041)
 * just after formulating this I realized that I actually need a dynamic permalink:-)))
   
   Google gave me these: [https://jasonyingling.me/dynamically-overwrite-wordpress-permalinks-with-filters/](https://jasonyingling.me/dynamically-overwrite-wordpress-permalinks-with-filters/)
   [https://stackoverflow.com/questions/51217355/custom-permalink-with-dynamic-rewrite-tags-on-a-wordpress-custom-post-type](https://stackoverflow.com/questions/51217355/custom-permalink-with-dynamic-rewrite-tags-on-a-wordpress-custom-post-type)
   AND [https://permalinkmanager.pro/docs/filters-hooks/how-to-programmatically-change-the-custom-permalinks/](https://permalinkmanager.pro/docs/filters-hooks/how-to-programmatically-change-the-custom-permalinks/)
 * !!!
    So, if I but the pro, will I be able to get this dynamic permalink thing
   and resolve this AddThis issue???
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12576054)
 * Hi again [@signale](https://wordpress.org/support/users/signale/),
 * The solution (I mean snippet) I gave you allows you to make the post permalinks
   dynamic 🙂
 * The posts added before (15th Feb 2020 – you can change that date) will be formatted
   like this:
    [https://aristake.com/?p=35](https://aristake.com/?p=35)
 * The new ones:
    [https://aristake.com/post/how-to-make-the-most-amount-of-tips-at-the-gig](https://aristake.com/post/how-to-make-the-most-amount-of-tips-at-the-gig)
 *     ```
       function bis_post_permalinks($permalink, $post) {
       	if(!empty($post->post_type) && $post->post_type == 'post') {
       		$home_url = trim(get_home_url(), '/');
   
       		// Old format
       		if(strtotime($post->post_date) < strtotime('2020-02-15')) {
       			$permalink = add_query_arg('p', $post->ID, $home_url);
       		}
       		// New format
       		else {
       			$permalink = sprintf('%s/post/%s', $home_url, $post->post_name);
       		}
       	}
   
       	return $permalink;
       }
       add_filter('post_link', 'bis_post_permalinks', 9999, 2);
       ```
   
 * Paid version will not be useful in this particular case.
 * Best regards,
    Maciej
 *  [signale](https://wordpress.org/support/users/signale/)
 * (@signale)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/#post-12578994)
 * You’re a LifeSaver! Literally. Thank you so much.
 * Now, please, if I add into this:
    `if(!empty($post->post_type) && $post->post_type
   == 'post')` the is_single() condition, `if(!empty($post->post_type) && $post-
   >post_type == 'post' && is_single())` will that mean I got pretty links on loops
   and the ugly ones on a signle post? Cause this is exactly what I need. My plan
   is to redirect from pretty to ugly(from blog to single), but having in the official
   permalink variable also the ugly url. This is how I intend to get the right value
   for AddThis share. (example [http://agency.smartleads.eu/post/how-to-be-a-better-performer/](http://agency.smartleads.eu/post/how-to-be-a-better-performer/)–
   it still shows the pretty, but when I try to share – it shows the ugly, but may
   be it’s only my imagination as I work on it for a while and can deceive myself)
 * I’ve tried it and it seems to work, but may be I missed something, some exception
   or something?
 * And one more thing, do you have may be a code for changing this “?p=number” tag
   into this “?post=number”?

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/page/2/?output_format=md)

The topic ‘Changing the default WordPress permalink settings’ is closed to new replies.

 * ![](https://ps.w.org/permalink-manager/assets/icon.svg?rev=2625166)
 * [Permalink Manager Lite](https://wordpress.org/plugins/permalink-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/permalink-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/permalink-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/permalink-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/permalink-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/permalink-manager/reviews/)

 * 20 replies
 * 3 participants
 * Last reply from: [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/changing-the-default-wordpress-permalink-settings/page/2/#post-12579756)
 * Status: resolved