Can I protect just a content inside the_content() and not the whole topic?

Lets said I have a shortcode for display a block of content, the shortcode was created on the WP Admin side so it’s inside the_content(), there is any way to protect that content just the shortcode part from unpaid users? How? Any get ride on this one?

  • Vinod Dalvi
    • WP Unicorn

    Hi Luis,

    Welcome to the WPMU Dev community and thank you for your question.

    Just create a Membership Access Level by properly configuring it and then wrap your shortcode with the create Membership Access Level shortcodes as displayed below by getting Membership Access Level shortcodes from the Membership Access Levels page as shown in the attached screenshot.

    Add your shortcode here

    Alternatively you can protect the output of the_content function by replacing it with the following code.

    echo do_shortcode( '[levelshortcode]'.get_the_content().'[/levelshortcode]' );

    In the above code change the shortcode levelshortcode with the appropriate Membership Access Level shortcodes.

    Find more information about usage of this Membership plugin on the following page.

    Please advise if you have more questions.

    Best Regards,

    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.