Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Supprimer automatiquement les mots courts des URL pour un meilleur SEO dans WordPress

<?php
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);
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: ci4+ connection code 
Php :: php generate html attributes from array 
Php :: PHP quoted_printable_encode — Convert a 8 bit string to a quoted-printable string 
Php :: delete request php-salesforce-rest-api 
Php :: how to pass variable to an event listener laravel 
Php :: Yii2: Setting default values for all attributes of a model 
Php :: php if simple 
Php :: Argument 1 passed to DoctrineInflectorInflector::singularize() must be of the type string, null given, 
Php :: codeigniter remote queries very slow 
Php :: list.blade.php 
Php :: This behaviour is (currently) not supported by Doctrine 2 
Php :: woocommerce_continue_shopping_redirect 
Php :: schema key issue laravel 
Php :: how to superscript th in php date 
Php :: how to get php code from website 
Php :: laravel get previous route without domain 
Php :: codeigniter sanitize array in php 
Php :: php artisan reset --force 
Php :: get first row of array php 
Php :: PHP stripos — Find the position of the first occurrence of a case-insensitive substring in a string 
Php :: laravel insert multiple rows from form 
Php :: php $_POST contains 
Php :: carbon in laravel documentation 
Php :: code to set error for du[licate entry in php 
Php :: 12 months service expiary in php 
Php :: find only selected columns 
Php :: fichier wp-config.php 
Php :: nested attributes - PHP 8.1 
Php :: howto+add+header+bar+laravel+app 
Php :: laravel get polymorphic names 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =