The part that modifies the blog post URLs/permalinks is in the mandoe_update_post_link()
function (which is hooked on post_link
), and the part that you need to adjust is this:
return home_url( '/blog/' . $post->post_name );
Just change the '/blog/' . $post->post_name
to '/blog/' . $post->post_name . "https://wordpress.stackexchange.com/"
and the URLs would end with a slash. However, you may need to clear your site (and browser) caches in order for your sitemap to be using the new URL format, or for you to see the changes applied.
Related Posts:
- When should add_rewrite_tag() be used?
- Why does everybody hook add_rewrite_rule on init
- add_rewrite_rule() vs $wp_rewrite->rules vs ‘rewrite_rules_array’?
- How to check if a rewrite rule exists
- Querystring parameter getting lost in rewrite rule
- add_rewrite_rule not producing anything in $_GET
- Flush_rewrite_rules not working when settings updated
- Prettified page URL w/ query var redirects to prettified page URL w/o query var
- Making extra parameters optional
- flush_rewrite_rules() cancels the effect of add_rewrite_rule()
- why is are these rewrite_tags and rules not working?
- Separate posts by chapter per rewrite
- Redirect taxonomy to custom template to list terms in taxonomy
- How to change the matches in add_rewrite_rule
- Using add_rewrite_rule() to redirect to Front Page
- What add_rewrite_tag()’s RegEx matches against?
- add_rewrite_rule() not working
- add_feed and flush_rewrite_rules
- Rewrite rules and query for virtual page
- add_rewrite_rules prefix everything
- Can someone explain the function of the third parameter of “add_rewrite_tag”
- Best action to call add_rewrite_rule
- get_query_var with add_rewrite_rule and add_filter(‘query_vars’) not working
- Can rewrites fallback if 404? Rewrite conflict issue
- add_rewrite_rule query_var not being set
- Where do I USE add_rewrite_rule?
- add_rewrite_rule confusion
- add_rewrite_endpoint not working
- Associate the “add_rewrite_endpoint” and “$_GET”
- Uppercase to Lowercase in URL
- How to use rewrite rule or rewrite endpoint to switch languages?
- Remove rewrite endpoint on deactivation?
- Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?
- Hooking “delete_option_rewrite_rules” for rewrite rule addition
- Optimal code for two add_rewrite_rule’s
- WordPress shows front page, when it should show 404 with pagination style urls
- How do I flush rewrite rules
- add_rewrite_rule redirects if value = 1
- rewrite url in wordpress
- add_rewrite_rule permalinks break in WordPress 4.5
- How to add rewrite rule for external php file
- Making extra parameters optional
- My add_rewrite_rule is returning a 404
- wordpress add_rewrite_rule not working
- force_ssl_admin() causing issues with preview links
- $wp_rewrite->rules is always NULL
- Rewrite Rules problem when rule includes homepage slug
- Order of rewrite rules when calling add_rewrite_rule
- WooCommerce – Conditional for page created by rewrite_rule
- add_rewrite_rule() not stored (I think)
- WordPress add_rewrite_rule second argument not working
- flush_rewrite_rules() not working on updating Settings API
- Rewrite rules priority
- Rewrite rules for short URL
- How do I turn off the blog and archives?
- Adding a custom rewrite rule for gallery/categories page
- Grab last part of the url inside rule
- Why isn’t my rewrite rule working when there is no second parameter?
- Rewrite rules applied differently after upgrade
- How to do make mysite.com/post-name/sub-post?
- Custom rewrite rules for a page with GET variables?
- WordPress add a rewrite rule to a page to accept a GET variable
- “/” URLs without trailing slash shows 404
- How can I resolve search error with pagination wordpress
- CPT – Nice url with add_rewrite_rule
- WordPress – replicate same globals, query vars and query for an alternate endpoint
- rewrite rule not working: redirect to php script if file exists
- WordPress add_rewrite_rule with 2 variables
- Rewrite rule not working, issue may be in URI request
- Overcoming a complex WordPress page rewrite rules request
- Rewrite post type into a page with year filter
- How to create a custom URL to another domain in WordPress
- WordPress matching URLs with trailing tildes code correction
- Rewrite Rules, Query Vars and Pagination
- Pretty links with add_rewrite_rule and add_query_var
- Flush rewrite rules when every page gives 500 error?
- Using add_rewrite_rule in conditional statement using $_SERVER
- How to change URL in WordPress
- WordPress Rewrite rule with custom query var
- default ‘post’ post type: not forcing url rewrite when args set
- How to add rewrite rule to point to file
- Last query_var not working with rewritten URL
- How to use endpoint, but remove/rewrite endpoint base?
- add_rewrite_rule doesn’t work for me
- Adding custom slugs: parent-page/username/child-page/
- Rewritten URL not loading WordPress environment
- WordPress Custom post type single page 404 error
- How bad is flush_rules() on init hook?
- Rewrite for page with a possible unknown parent page
- Rewrite the WordPress URL from custom plugin
- add_rewrite_rule works only with one “directory”
- Passing variables in the permalink structure on a custom post type
- How to Add Rewrite Ruled Argument Into Permalink Properly
- WordPress Rewrite Rules
- add_rewrite_rule with trailing slash redirects
- nginx + W3 Total Cache: rewrite rules issue [closed]
- Custom URL rewrite with add_rewrite_rule
- Rewrite rule to index.php in theme subfolder
- WordPress rewrite rule – not able to access second and third parameters
- Custom URL Rewrite Rules not working