After SO MANY research, I found a Great Simple solution via https://stackoverflow.com/a/54251892/10403689 (vote this ⬆UP⬆)
Your Permalink Structure should be: /%category%/%postname%/
function no_post_slash( $string, $type ){
if($type == 'single')
$string = untrailingslashit($string);
return $string;
}
add_filter('user_trailingslashit', 'no_post_slash', 70, 2);
BUT this is only working on single_post not pages
Related Posts:
- corrupted URLs – can’t leave starting page
- WordPress permalink still not working (error or not understood?)
- Need help with add_rewrite_rule
- remove “index.php” from permalinks
- How does WordPress handle permalinks?
- Pretty permalinks for search results with extra query var
- Custom post type permalink endpoint
- How to add a custom URL placeholder to author archives?
- URL rewrite based on a custom field value
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Make post slug have priority over category slug
- Using two permalinks for one post
- flexible rewrite ‘ramble’ URLs with WordPress
- Change the custom post type permalink
- Redirect short-form URL to long-form URL (post_id to post_id + post_name)
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Rewrite url / permalink for default archive – yearly / monthly
- Random Alphanumeric Key URLs
- Permalinks, Rewrites, Get Variables, Oh My!
- Rewrite-Rules not working on a vhost, everything goes to index.php
- Using WP rather than .htaccess to redirect pages/posts
- Change permalink for a single post entry
- Does WordPress send a 301 header message when you change permalink structures?
- How to Modify Existing Rewrite Rules?
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- custom permalink/shortlink with base62 encoded post ID
- Can’t get rewrite rules working
- When is it a good idea to build a permalink structure from scratch?
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Call to a member function add_rule() on a non-object
- I need a custom permalink for my website
- Permalinks: Page Not Found
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Re-write specific custom post type category URL to go to another page
- Remove custom taxonomy base from URL
- Custom Permalink
- remove sub-category of Custom Post Type from permalink structure
- add_rewrite_rule not working for me
- Is a permastruct possible on pages?
- Using WP Rewrite, but just not “getting it”
- Rewrite rule for a query string
- Share same Slug for a Custom Post Type and 2 Taxonomies
- How to remove specific category from URL in WordPress
- Redirect /%year%/%monthnum%/%day%/%postname% [closed]
- Rewrite CPT permalinks and include WPML language
- Redirect a Blogger Page URL to wordpress
- Custom permalink leads to index page
- Rewrite rule intended for CPTs gives 404 for pages
- Permalink structure between 2 custom post types and a taxonomy
- Passing the JQuery string to Worldpress URL
- Permalinks only for posts
- Custom rewrite rule ignored
- wordpress how to replace url /bar with foo/bar for custom post type
- Some Pemalink problems, probably caused by wrong .htaccess configuration?
- Getting back a permalink from custom url
- Order custom post type posts by custom field with pretty URL
- Adding URL prefix for foreign language support
- Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)
- Exclude single page from permalink rule
- help to remove last trailing slash using add_rewrite_rule
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- Custom permalink structure with %postname% in front of domain name
- How can I set up a secondary permalink structure?
- Rewrite rule not passing variable
- How to Use metada Value in Url and is it possible? [duplicate]
- Safest way to create a custom permalink
- rewrite based slug standar post wp
- Create different permalinks for same post
- Multiple Taxonomy Items for Separate URLs
- Multiple URL rewrite rules and get every prams
- Using a template file for a specific custom URL
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Redirect page to homepage, keeping URL
- Add slug to default post permalinks ONLY
- how to have same rewrite rules for 2 different post type?
- Permalink structure /page/page/cpt-post gives 404 with pagination
- What permastrusture tags are generated out of the box right after creating custom post types and taxonomies?
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- Rewrite posts url as they’re all children of a page
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Pretty Filter URL
- WordPress Pagination Custom Rewrite Rule for Pages
- rewrites and custom links in page need help with add_rewrite_rule
- Prevent guessing slug
- All pages lead to home
- My wordpress site must be being affected by outside sources [duplicate]
- WordPress custom permalinks, pages are now 404
- Add additional URL variations for a Post
- Use Regular Expression to get tag from permalink url during wp_rewrite in generate_rewrite_rules
- Add prefix to page URL based on the page template
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- Freeze child page URLs so parent permalink changes don’t give 404s?
- What causes /pages/ to appear in URI, and how to remove it?
- How Do I get the author’s page id?
- change WordPress permalinks and redirect new urls 301
- Custom permalink structure for custom post types including multiple taxonomy
- WordPress not remembering old slugs for pages