Title: Hard Coded Search
Last modified: September 1, 2016

---

# Hard Coded Search

 *  Resolved [nekton](https://wordpress.org/support/users/nekton/)
 * (@nekton)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/hard-coded-search/)
 * Hi there
 * Anyone know, how/if I can I hard code a search term for a (custom template) page?
 * I need to create a page that returns all posts/pages etc that contain a specific
   keyword.
 * So instead of having:
    [mysite.com/?=wombats](https://wordpress.org/support/topic/hard-coded-search/?output_format=md#)
 * I will have a the url:
    [mysite.com/wombats](https://wordpress.org/support/topic/hard-coded-search/?output_format=md#)
 * And that page that returns pages with “wombats” in.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [nekton](https://wordpress.org/support/users/nekton/)
 * (@nekton)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/hard-coded-search/#post-7555836)
 * doh! found it!
 *     ```
       // WP_Query arguments
       $args = array (
       	's'                      => 'brexit',
       );
   
       // The Query
       $query = new WP_Query( $args );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Hard Coded Search’ is closed to new replies.

## Tags

 * [search query](https://wordpress.org/support/topic-tag/search-query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [nekton](https://wordpress.org/support/users/nekton/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/hard-coded-search/#post-7555836)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
