How do I remove a word from a url in WordPress using .htaccess?

You can add the following to your .htaccess file in between the <IfModule mod_rewrite.c> tags:

RewriteCond %{HTTP_HOST}
RewriteRule ^our-focus/(.*)$ /focus/$1 [R=301,L]

Your .htaccess should looks like the following:

# 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]
# Custom Rewrite
RewriteCond %{HTTP_HOST}
RewriteRule ^our-focus/(.*)$ /focus/$1 [R=301,L]
</IfModule>
# END WordPress

As a result it will do the following:

http://example.com/our-focus/test

Redirects to:

http://example.com/focus/test

Leave a Comment