• Resolved newusername

    (@newusername)


    Right now whenever I approve new testimonial it receives its own url (with address like somesite.com/testimonial/name-of-a-testimonial), is there a way to stop the plugin from creating these urls? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter newusername

    (@newusername)

    Sorry for the mistype, I means “forbid”

    Thread Starter newusername

    (@newusername)

    *I meant

    anonymized-13171256

    (@anonymized-13171256)

    The Properties add-on gives you complete control over that.
    https://strongplugins.com/plugins/strong-testimonials-properties/

    Or add this to your theme’s functions.php or an mu-plugin:

    /**
     * Testimonial post type
     */
    function my_testimonial_cpt( $args ) {
    	$args['public'] = false;
    	return $args;
    }
    add_filter( 'wpmtst_post_type', 'my_testimonial_cpt' );

    Then go to General Settings > Permalinks and simply click Save Changes.

    That will disable testimonial permalinks and consequently the “Read more” option.

    Thread Starter newusername

    (@newusername)

    Thank you. Now when I visit the testimonial at its previous url, I get redirected to the main page, so all new testimonials (and all old ones) still get urls, they just get redirected (301). But is there a way to stop testimonials from forming new urls completely? So that such urls (site.com/testimonials/name-of-testimonial) wouldn’t exist (404 error), and not just get redirected? Or am I mistaken in saying that testimonials urls are now redirected? Thanks again.

    anonymized-13171256

    (@anonymized-13171256)

    Try this instead:

    /**
     * Testimonial post type
     */
    function my_testimonial_cpt( $args ) {
    	$args['public'] = false;
    	$args['publicly_queryable'] = false;
    	$args['exclude_from_search'] = true;
    	$args['query_var'] = false;
    	return $args;
    }
    add_filter( 'wpmtst_post_type', 'my_testimonial_cpt' );
    
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Forbig creating urls’ is closed to new replies.