Support » Plugin: The SEO Framework » Use SEO tags with Force Login plugin

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Pierre LeBaux

    (@lebaux)

    Hey Rui, WP Force Login redirects everyone to login page, so when Facebook or WhatsApp requests preview, they are too redirected to login page. I know what you want, but it is close to impossible from technical standpoint.

    I am sorry I can not give you better news.
    These plugins are pretty much in conflict, our plugin helps your website to get discovered, WP Force Login keeps it private.

    Regards,
    Pierre

    Thread Starter Rui Cruz

    (@ruicruzpt)

    Hello Piere,

    I just look up your profile, and you’re another WordCamp Speaker, yay. πŸ˜‰

    Actually, I figure out a way to do it. I’ll leave it here for anyone who want it.
    If you somehow want to implement this somehow in your plugin, I see a point on adding this in future releases “if” plygin X is installed, show some kind of option, for example?

    I see a demand for this in scenarios like a private site needs to still be shown with a nice look in social media.

    Here is my code:

    //changing Meta data of Login page
    add_action( 'login_head', 'login_meta_changing' );
    function login_meta_changing(){
    	echo'<meta name="title" CONTENT="changethis">';
    	echo'<meta name="description" CONTENT="changethis">';	
    	echo'<meta property="og:url" CONTENT="changethis">';
    	echo'<meta property="og:title" CONTENT="changethis">';
    	echo'<meta property="og:description" CONTENT="changethis">';
    	echo'<meta property="og:image" content="changethis">';
    	echo'<meta property="og:image:secure" content="">';
    }

    At least in my installation, it’s working.

    Other users, beware: backup your funtions.php before adding this and use https://developers.facebook.com/tools/debug/ to update the opengraph after adding this. As always, use at your own risk. πŸ˜›

    Plugin Support Pierre LeBaux

    (@lebaux)

    Hey Rui, now I feel like a dumbass for saying it is “close to impossible” while it took you 15 minutes to solve it.

    I just look up your profile, and you’re another WordCamp Speaker, yay. πŸ˜‰

    I should spend more time in PHP, apparently! I saw you spoke Lisbon, but I do not really speak the language. Is there somewhere video from your Dublin talk?

    I see a point on adding this in future releases β€œif” plygin X is installed, show some kind of option, for example?

    I see a demand for this in scenarios like a private site needs to still be shown with a nice look in social media.

    I do not know, your scenario feels somehow rare, but I get your point and I agree it private pages sometimes might want to reveal some metadata. I have to ask @cybr (since he is the one in our company who actually knows how to code) if this would be a viable extension and if there are any caveats (security, maintenance, possible plugin conflicts). Maybe we can turn this into KB article.

    Have a nice day and sorry for my previous (lazy) support reply!
    Pierre

    Thread Starter Rui Cruz

    (@ruicruzpt)

    Don’t worry, actually it took me more than 15 minutes πŸ˜€ I just forgot to post the solution before your reply.

    No, they didn’t publish Dublin yet unfortunately :;(

    Ok, no problem, even if you don’t apply it to a plugin, I leave it here for others to find.

    Thank you.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    This is a true edge-case to us because login pages are often (and automatically) hidden from the public, but our door is always open for feature requests at our GitHub:
    https://tsf.fyi/git/tsf/issues/new/choose

    Since TSF gives a big hug to WordPress’s multi-page structure, which you’ve toned down to 1 page, you may find adverse effects, such as conveying misinformation in the admin area and a sitemap that populates with various inaccessible links of the site.

    If you want search engines to index the login page (beware of automated brute force attempts…), then you’ll also need to implement this snippet:

    // Some unfortunately inapt names, because, well, edge-case...
    add_action( 'login_enqueue_scripts', remove_action( 'login_head', 'wp_sensitive_page_meta' ) );

    Please mind that the code aforementioned also removes a tag that enhances browser-security, which you probably want to reimplement in the login_head:

    <meta name='referrer' content='strict-origin-when-cross-origin' />
    

    I hope this sheds some more light on the issue πŸ™‚ Cheers!

    Thread Starter Rui Cruz

    (@ruicruzpt)

    Hello,

    That code will also be useful. Thank you for your imput!

    Plugin Author Sybre Waaijer

    (@cybr)

    Cheers πŸ™‚

    The code I shared is utterly useless. Perhaps I spent too much time around JavaScript. πŸ˜…

    Here’s the correct version:

    // Some unfortunately inapt names, because, well, edge-case...
    add_action( 'login_enqueue_scripts', function() { 
        remove_action( 'login_head', 'wp_sensitive_page_meta' );
    } );
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.