WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assuming I have this URL:


How can I change it to a nice URL that looks like:


using WP's URL rewriting system?

share|improve this question
up vote 1 down vote accepted

First add get to query vars array:

function add_query_vars_wpa12572($vars) {
    $vars[] = 'get'
    return $vars;

add_filter('query_vars', 'add_query_vars_wp12572');

then add the rewrite rule

function author_rewrite_rules_wpa12572( $wp_rewrite ) {
  $newrules = array();
  $new_rules['get_(\d*)$'] = 'index.php?get=$matches[1]';
  $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.