• Hi, is there a way for post titles and excerpts to be made available through search engines, such as Google, but when a user clicks on the title link, they are taken to a WordPress page that asks them to login or register to become a subscriber. In other words, we want to drive users to our site by allowing only titles and excerpts to be publicly searchable, but require the user to login to actually see the content.

    Also, some of our content will not require the user to login. We need to be able to also allow some of our content to be seen publicly.

    Is there a plugin that will allow this? Or some other way to implement this?

    Thank you!
    Gail

Viewing 4 replies - 1 through 4 (of 4 total)
  • Though it is only compatible up to WordPress 4.3.3, this plugin: Private Content or you could search for one similar.

    Thread Starter gailwingate1

    (@gailwingate1)

    Hi, this won’t work for us because of the way our content is loaded, or posts are created. The authors, editors cannot be responsible for entering shortcodes to determine what is viewable. This must be a behind-the-scenes process.

    Part of the issue is that our content restrictions are also set via a custom taxonomy which is fine when using the WordPress search capability. But when someone comes to our site from a search engine such as Google, I need the system to somehow find the post with that title, and see what the custom taxonomy values are, and depending upon those values either display the content or take the user to our members login page.

    I’ve spent almost a week searching through the plugins and there is nothing that I can find that will do this. And I don’t know Javascript. Surely I’m not the only one that has this problem?

    I’m really hoping someone can help me with this.

    Regards,
    Gail

    but when a user clicks on the title link, they are taken to a WordPress page that asks them to login or register to become a subscriber.

    Those posts/pages that you want people to login to see, turn them “private” > WordPress Codex : Content Visibility

    Thread Starter gailwingate1

    (@gailwingate1)

    Hi, thank you for your response. We can’t set that parameter from the front-end post creator plugin that I’m using. So someone suggested I run the following php function code but I’m not sure how to call the code so that it will run every time any url on our website function from a search engine.

    redirect_from_search_engines() {
    	$url = parse_url( $_SERVER['HTTP_REFERER'] );
    	$sites = array( 'google', 'yahoo', 'bing' );
    	foreach( $sites as $site ) {
    		if ( ! stristr( $url['host'], $site ) ) continue;
    
    		$terms = get_the_terms( get_the_ID(), 'role' );
    
    		if ( (! is_user_logged_in()) and ( ! is_array( $terms ) || ! in_array( 'general-public', $terms ) ) ) continue;
    
    		wp-redirect('https://www.mders.org/my-membership-options');
    	}
    }
    add_action( 'wp', 'redirect_from_search_engines' );

    Does that make sense?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Content available by searching’ is closed to new replies.