- function wpb_change_search_url() {
- if ( is_search() && ! empty( $_GET['s'] ) ) {
- wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
- exit();
- }
- }
- add_action( 'template_redirect', 'wpb_change_search_url' );
Change WordPress search Url |
---|
|
How to change ?s=search
From
To
1. Go to your hosting panel and go to domain.com/wp_content/themes/functions.php 2. Open Function.php from your activated Theme and Add following code bottom of all codes.
Save and Enjoy.
Now, go to your site and search something to get result.
|
Published: | February 20, 2019 |
Author: | admin |
Category: | Wordpress Code |
Views: | 25 |
This article was posted in Wordpress Code and tagged Change Wordpress search Url. Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.
|
|