|
/ Documentation /Custom Code Snippets/ Customizing the Community Post Slug Using a Filter

Customizing the Community Post Slug Using a Filter

By default, SureDash uses community-post as the URL base for shared community posts. So a post link looks like /community-post/my-post/. If that doesn’t match your site’s URL structure or branding, you can change it to anything you like, such as /discussions/my-post/ or /posts/my-post/.

SureDash includes a built-in filter called suredash_community_post_slug that makes this possible without editing any core plugin files.

Before You Begin

  • You need access to your child theme’s functions.php file, or the ability to create a small mu-plugin.
  • Make sure the slug you choose does not clash with an existing page or post slug on your site.

Steps

  1. Open your child theme’s functions.php file (or create a new file inside your site’s wp-content/mu-plugins/ folder).
  2. Add the following code snippet:
add_filter( 'suredash_community_post_slug', function ( $slug ) {
    return 'discussions'; // change to your preferred slug
} );
  1. Replace discussions with the slug you want to use. For example, posts, share, or updates.
  2. Save the file.
  3. Go to your WordPress dashboard and navigate to Settings > Permalinks.
  4. Click the Save Changes button once. You do not need to change any setting. This step simply refreshes the URL rules so your new slug takes effect.

What You Will See

Once done, all community post share links will use your new slug. For example, if you set the slug to discussions, links will now look like /discussions/my-post/ instead of /community-post/my-post/.

You have now updated the community post slug to match your preferred URL structure. This is a small but useful change that keeps your site URLs clean and consistent.

If you have any questions or need further help, feel free to reach out to our support team. We’re always happy to help!

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Scroll to Top