Here in this article I going to show you, how we can remove unwanted image sizes from wordpress theme. Using code snippet, remove unwanted image sizes

Remove short words from wordpress permalink URL

WordPress itself creates the permalink. WordPress permalinks are very important for SEO purpose. Short words are sometimes are not good for seo so you might need to remove the short words from permalink. Using the following code you can remove the short words from wordpress permalink URL.

Using code you can Remove short words from wordpress permalink.

You just need to add the following code functions.php file.

add_filter('sanitize_title', 'remove_short_words');
function remove_short_words($slug) {
 if (!is_admin()) return $slug;
 $slug = explode('-', $slug);
 foreach ($slug as $k => $word) {
 if (strlen($word) < 3) {
 unset($slug[$k]);
 }
 }
 return implode('-', $slug);
}

 

Source Link :wpsnipp.com

 

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

One thought on “Remove short words from wordpress permalink URL”

  1. i was searching for how to remove short link these days
    thank you for your tutorial, helped me as a new blogger
    i will comeback to check more tutorials

Leave a Reply

Your email address will not be published.