Title: Change default Slug &#8220;chart&#8221;
Last modified: November 22, 2021

---

# Change default Slug “chart”

 *  Resolved [datverse](https://wordpress.org/support/users/datverse/)
 * (@datverse)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/change-default-slug-chart/)
 * Hi,
    Default slug for Chart post type is “chart” ([https://my-domain.com/chart/my-chart](https://my-domain.com/chart/my-chart)).
   How can I change “chart” to “something”? Can you add a feature to do this? Thanks.

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

 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/change-default-slug-chart/#post-15093598)
 * There’s a few ways to do this that don’t actually require any changes to the 
   plugin.
 * Basically you just need to change it before it gets created in WP.
 * Something like this added to your functions.php file should work:
 *     ```
       <?php
   
       add_filter( 'm-chart_post_type_args', 'm_chart_post_type_args' );
   
       function m_chart_post_type_args( $args ) {
           $args['rewrite']['slug'] = 'your-new-slug-here';
   
           return $args;
       }
       ```
   
 *  Thread Starter [datverse](https://wordpress.org/support/users/datverse/)
 * (@datverse)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/change-default-slug-chart/#post-15094288)
 * Hi,
    Thank for your reply. I should use “register_post_type_args” “filter” and
   it work 🙂
 *     ```
       add_filter( 'register_post_type_args', 'm_chart_post_type_args', 10, 2 );
   
       function m_chart_post_type_args( $args, $post_type ) {
   
       	if ( 'm-chart' === $post_type ) {
       		$args['rewrite']['slug'] = 'foo-chart';
       	}
   
       	return $args;
       }
       ```
   
 * Thanks

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

The topic ‘Change default Slug “chart”’ is closed to new replies.

 * ![](https://ps.w.org/m-chart/assets/icon-256x256.png?rev=3472197)
 * [M Chart](https://wordpress.org/plugins/m-chart/)
 * [Support Threads](https://wordpress.org/support/plugin/m-chart/)
 * [Active Topics](https://wordpress.org/support/plugin/m-chart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/m-chart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/m-chart/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [datverse](https://wordpress.org/support/users/datverse/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/change-default-slug-chart/#post-15094288)
 * Status: resolved