comment 0

Change plus into minus on search permalink

change the plus into minus on search permalink

How to change the plus into minus on search permalin? usually we found our search permalink was and here its the way to change into .

1. Login to your cpanel,

2. Open the file manager and goto themes directory, wp-content/themes/your-themes

3. Open search.php on your themes

4. Copy and paste this code on the first line before get header function , <?php get_header(); ?>

$ganti = array('+',' '); //tanda plus dan spasi
$urlredirect = get_settings('home') . '/search/' . str_replace($ganti, '-' ,$_GET['s']). ''; //tanda plus dan spasi jadi minus
header("HTTP/1.1 301 Moved Permanently");
header( "Location: $urlredirect" );

5. Save your search.php , open the dashboar (wp-admin) goto permalink settings, save the settings and preview your site, thats work on my site

Happy Coding ^ ^



Leave a Reply

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