Title: Customize search function
Last modified: January 3, 2021

---

# Customize search function

 *  [baronjones](https://wordpress.org/support/users/baronjones/)
 * (@baronjones)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/customize-search-function-3/)
 * Hi all!
 * First post on WP.org, wihoo!
 *  I need help to remove the function of “search results page” when using the search
   function.
 * I want the function of the searchbar to be like this:
 * User put in search text etc “0084”, hits enter.
    Searchbar should be redirecting
   to “productpage” of id 0084, not the result page with 0084. If there’s no id “
   0084” it would show “no results found page”.
 * Many thanks in advance!
    BaronJones
    -  This topic was modified 5 years, 4 months ago by [baronjones](https://wordpress.org/support/users/baronjones/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustomize-search-function-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/customize-search-function-3/#post-13858428)
 *     ```
       <form onsubmit="window.location = '<?php echo $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME']; ?>/productpage/' + search.value; return false;">
       <input id="search" placeholder="Search" type="search" name="search"></input>
       <input type="submit" value="Send">
       </form>
       ```
   
 * Obviously change what you need. You’re not actually using WP search but rather
   just redirecting to a page so don’t use native WP search for this.

Viewing 1 replies (of 1 total)

The topic ‘Customize search function’ is closed to new replies.

## Tags

 * [etc.](https://wordpress.org/support/topic-tag/etc/)
 * [Searchbar](https://wordpress.org/support/topic-tag/searchbar/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/customize-search-function-3/#post-13858428)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
