How To Remove Trailing Slash From WordPress Permalink?

To remove trailing slash from WordPress Permalink, follow below two steps

remove trailing slash
Setup Custom Structure with non-slash

Step 1. Update Permalink Structure

  1. Login to WordPress Dashboard
  2. Go to Settings > Permalinks
  3. Select Custom Structure
  4. Type /%postname%
  5. Save Changes.

Step 2. Force Non-Trailing Slash via Redirection 301

  1. Edit .htaccess file
  2. Add below rules just before the WordPress Default Rewrite Rules.
  3. Save Changes.
# Force Non Trailing Slash
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Author Note: This method works perfect with all plugins, except for those who don’t respect WordPress Permalink Structure. For example, AMP for Pages doesn’t support this feature.

Please feel free to ask in the below comment section, if you have any query.

Subscribe our blog via Email
Get instant updates of our new blog post directly at your Mailbox.

2 Comments

  1. Rajan Tomar February 14, 2017 Reply

Add a Comment

Your email address will not be published. Required fields are marked *

Please don't use SMS lang. By commenting on this article, you agree to our .