Title: %monthnum2% cannot be read
Last modified: September 9, 2021

---

# %monthnum2% cannot be read

 *  Resolved [Helen Grace Tacang](https://wordpress.org/support/users/helentacang/)
 * (@helentacang)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/monthnum2-cannot-be-read/)
 * I tried adding /%monthnum2%/ on the permalink structure to remove the 0 on the
   months and dates but it’s not being read by the plugin. It removes the month 
   and day on the URL slug instead.

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

 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/monthnum2-cannot-be-read/#post-14856311)
 * Hi [@helentacang](https://wordpress.org/support/users/helentacang/),
 * This tag is not included neither in Permalink Manager nor WordPress core codebase.
 * Actually, I have found that this tag (with a custom code snippet and detailed
   instructions) is mentioned only in this article:
    [https://wordpress.stackexchange.com/a/330933/38240](https://wordpress.stackexchange.com/a/330933/38240)
 * Unfortunately, to remove the trailing zeros with my plugin you will need to use
   code snippet:
 *     ```
       /**
        * Use single-digit month number in permastructures
        * Use %monthnum2% or %daynum2% in "Permastructure" settings
        */
       function pm_date_tags($default_uri, $post) {
       	if(empty($post->post_type)) {
       		return $default_uri;
       	}
   
       	if(strpos($default_uri, '%monthnum2%') !== false) {
       		$monthnum = date('n', strtotime($post->post_date));
       		$default_uri = str_replace('%monthnum2%', $monthnum, $default_uri);
       	}
   
       	if(strpos($default_uri, '%daynum2%') !== false) {
       		$daynum = date('j', strtotime($post->post_date));
       		$default_uri = str_replace('%daynum2%', $daynum, $default_uri);
       	}
   
       	return $default_uri;
       }
       add_filter('permalink_manager_filter_permastructure', 'pm_date_tags', 5, 2);
       ```
   
 * Please simply paste it to functions.php in your child theme directory. Then you
   will be able to use both %monthnum2% and %daynum2% in Permastructure settings.
 * Best regards,
    Maciej
 *  Thread Starter [Helen Grace Tacang](https://wordpress.org/support/users/helentacang/)
 * (@helentacang)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/monthnum2-cannot-be-read/#post-14858503)
 * Thanks, Maciej!!
 * I tried it out and it’s working 🙂
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/monthnum2-cannot-be-read/#post-14858608)
 * Hi [@helentacang](https://wordpress.org/support/users/helentacang/),
 * I am happy to help 😉

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

The topic ‘%monthnum2% cannot be read’ is closed to new replies.

 * ![](https://ps.w.org/permalink-manager/assets/icon.svg?rev=2625166)
 * [Permalink Manager Lite](https://wordpress.org/plugins/permalink-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/permalink-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/permalink-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/permalink-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/permalink-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/permalink-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/monthnum2-cannot-be-read/#post-14858608)
 * Status: resolved