Title: Permalink : %tag%  not working
Last modified: August 19, 2016

---

# Permalink : %tag% not working

 *  [nelloxa](https://wordpress.org/support/users/nelloxa/)
 * (@nelloxa)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/permalink-tag-not-working/)
 * Hello
    I’m configuring permalinks. All the tags discussed in [http://codex.wordpress.org/Using_Permalinks](http://codex.wordpress.org/Using_Permalinks)
   seems to work, except for %tag%.
 * I tried %year%, %postname% and %category% : everything is fine
    BUT if I use %
   tag%, I find it in the post link (i.e. this is not interpreted : my URL looks
   like : [http://www.example.com/2010/06/10/%tag%/myposttitle](http://www.example.com/2010/06/10/%tag%/myposttitle))

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [rajeshhonrao](https://wordpress.org/support/users/rajeshhonrao/)
 * (@rajeshhonrao)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/permalink-tag-not-working/#post-1544631)
 * Which version are you using? I am using WordPress 2.9.2,had same issue, here 
   is the patch for ‘wp-includes/link-template.php’
 *     ```
       *** link-template.php   2009-12-14 05:09:55.000000000 -0500
       --- link-template_patched.php   2010-06-21 14:29:24.000000000 -0400
       ***************
       *** 88,93 ****
       --- 88,94 ----
                       $leavename? '' : '%postname%',
                       '%post_id%',
                       '%category%',
       +         '%tag%',
                       '%author%',
                       $leavename? '' : '%pagename%',
               );
       ***************
       *** 128,134 ****
       --- 129,151 ----
                                       $category = is_wp_error( $default_category ) ? '' : $default_category->slug;
                               }
                       }
       +
       +               if ( strpos($permalink, '%tag%') !== false ) {
       +                       $tags = get_the_tags($post->ID);
       +
       +                       if ( $tags ) {
       +                               usort($tags, '_usort_terms_by_ID'); // order by ID
       +                               $tag = $tags[0]->slug;
       +                       }
   
       +                       // show default tag in permalinks, without
       +                       // having to assign it explicitly
       +                       if ( empty($tag) ) {
       +                               $default_tag = get_tag( get_option( 'default_category' ) );
       +                               $tag = is_wp_error( $default_tag ) ? '' : $default_tag->slug;
       +                       }
       +               }
       +
                       $author = '';
                       if ( strpos($permalink, '%author%') !== false ) {
                               $authordata = get_userdata($post->post_author);
       ***************
       *** 147,152 ****
       --- 164,170 ----
                               $post->post_name,
                               $post->ID,
                               $category,
       +             $tag,
                               $author,
                               $post->post_name,
                       );
       ```
   
 *  Thread Starter [nelloxa](https://wordpress.org/support/users/nelloxa/)
 * (@nelloxa)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/permalink-tag-not-working/#post-1544683)
 * I’m on WordPress 2.9.2, thanks for the patch.
    However, I wonder why this is 
   not patched. Shall I report the bug somewhere else ?
 *  [tribsel](https://wordpress.org/support/users/tribsel/)
 * (@tribsel)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/permalink-tag-not-working/#post-1544700)
 * I had the same problem on wp2.9 and its still the same with wordpres 3.0.
    I 
   would also like to know if there is a reason for it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Permalink : %tag% not working’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [tribsel](https://wordpress.org/support/users/tribsel/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/permalink-tag-not-working/#post-1544700)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
