[wp-hackers] changing the default search parameters

Jennifer Hodgdon yahgrp at poplarware.com
Mon Feb 18 16:49:28 GMT 2008

I think it is possible to do, if you define your own custom rewrite 
rules to convert your form of the URL to result in the same query 
variables that WP uses for its form of the search URL.

Suggested reading:

http://codex.wordpress.org/Query_Overview - to understand how WP 
converts URLs into pages of posts - this will also point you to 
sections of the WP code, in which you can find the default rewrite rules

http://codex.wordpress.org/Custom_Queries - has examples of how to use 
rewrite rules and query variables in plugins

(And of course, anything you can do in a plugin can be done in the 
functions.php file of a theme, too.)


Jonathan Dingman wrote:
> I'm trying to customize a theme here and part of the customization I want to
> do is to change the search parameters.
> I would like to change it from domain.com/?s=oldtest to something like
> domain.com/search?hl=en&q=newtest
> so changing s= to q= and adding the search?hl=en to it.

Jennifer Hodgdon * Poplar ProductivityWare

Drupal/WordPress Sites, Themes, Modules/Plugins
Custom Web Programming, Web Databases
Modeling/Analysis/Palm OS Software

More information about the wp-hackers mailing list