🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Method for WordPress to Require Following a WeChat Official Account to Reply for Visibility and Read More

Building your own websiteHow to attract followers to your official account? Requiring users to follow the official account and reply to make content visible is a very effective method for directing traffic to the official account. This article recommends 4 methods for viewing website content only after following an official account.

Method 1: Plugin Version for Official Account Traffic Diversion

For ordinary users, using the plugin version is the most convenient and quickest method. The plugin shared here is "WeChat Official Account Follower Growth". "The WeChat Official Account Follower Growth plugin can hide any part of the article content. After visitors follow your WeChat official account, they can obtain a verification code to view the hidden content. The front-end demonstration effect is as shown in the figure below:公众号回复可见 Usage Method:
  1. Download the plugin installation package
  2. Upload and install the plugin via the WP admin dashboard, and activate it
  3. Set up the official account information in the plugin's backend settings
  4. Add automatic reply keywords in the WeChat Official Account backend
Plugin DownloadPlugin 2:WeChat Public Platform Verification Code View Plugin

Method 2: Code Version for Official Account Traffic Diversion

1. The code-based method is similar to the plugin-based method. Copy the code below and paste it intoWordPress Themesthe functions.php file. Note to modify the QR code image address, name, and other content in the code below.
/**
 * wordpress微信公众号吸粉的3种方法
 * https://blog.naibabiji.com/skill/weixin-guan-zhu-ke-jian.html
 */
function lxtx_secret_content($atts, $content=null){
    extract(shortcode_atts(array('key'=>null,'keyword'=>null), $atts));
    if(isset($_POST['secret_key']) && $_POST['secret_key']==$key){
        return '<div class="secret-password">'.$content.'</div>';
    } else {
        return 
            '<div class="post_hide_box">
             <img class="erweima" align="right" src="改为二维码图片的网址" width="150" height="150" alt="你的二维码名字"><div class="post-secret"><i class="fa fa-exclamation-circle"></i>此处内容已经被作者无情的隐藏,请输入验证码查看内容</div>
             <form action="'.get_permalink().'" method="post"> 
             <span>验证码:</span><input id="pwbox" type="password" size="20" name="secret_key">
             <a class="a2" href="javascript:;"><input type="submit" value="提交" name="Submit"></a>
             </form>
             <div class="details">请关注“你的名字”官方QQ公众号,回复关键字“<span>'.$keyword.'</span>”,获取验证码。【注】用手机QQ扫描右侧二维码都可以关注“你的名字”官方QQ公众号。</div>
             </div>';
    }
}
add_shortcode('gzh2v', 'lxtx_secret_content');
2. Add the code below to the theme's style.css file.
.post_hide_box, .secret-password{background: none repeat scroll 0 0 #efe;border-left: 5px solid #e74c3c;color: #555;padding: 10px 0 10px 10px;border-radius: 5px;margin-bottom: 15px;overflow:hidden; clear:both;}
.post_hide_box .post-secret{font-size: 18px; line-height:20px; color:#e74c3c; margin:5px;}
.post_hide_box form{ margin:15px 0;}
.post_hide_box form span{ font-size:18px; font-weight:700;}
.post_hide_box .erweima{ margin-left:20px; margin-right:16px;}
.post_hide_box input[type=password]{ color: #9ba1a8; padding: 6px; background-color: #f6f6f6; border: 1px solid #e4e6e8; font-size: 12px;-moz-transition: border .25s linear,color .25s linear,background-color .25s linear; -webkit-transition: border .25s linear,color .25s linear,background-color .25s linear; -o-transition: border .25s linear,color .25s linear,background-color .25s linear; transition: border .25s linear,color .25s linear,background-color .25s linear;}
.post_hide_box input[type=submit] { background: #F88C00; border: none; border: 2px solid;border-color: #F88C00; border-left: none; border-top: none; padding: 0px;width: 100px; height: 38px; color: #fff; outline: 0;border-radius: 0 0 2px 0; font-size: 16px;}
.post_hide_box .details span{color:#e74c3c;}
3. Add a shortcode. When writing an article, you can directly insert the shortcode into articles where content is visible only after following the public account.
// 后台文本编辑框中添加公众号隐藏简码按钮
function lxtx_wpsites_add_gzh_quicktags() {
    if (wp_script_is('quicktags')){
?>
    <script type="text/javascript">
    QTags.addButton( 'gzh2v', ' 公众号隐藏', '\n[gzh2v keyword="关键字" key="验证码"]隐藏内容[/gzh2v]', "" );
    </script>
<?php
    }
}
add_action( 'admin_print_footer_scripts', 'lxtx_wpsites_add_gzh_quicktags' );
When publishing an article, the shortcode is as follows:
[gzh2v keyword="关键字" key="验证码"]隐藏内容[/gzh2v]

Method 3: Service for Reading Full Article Only After Following

This method is somewhat different from the previous two. It only hides part of the article content on the front-end via CSS code, but the full content can be seen in the source code, which does not affectwebsite SEOeffectiveness.公众号回复可见If you want to implement this method yourself using code, you can refer tothis article, but the author did not provide complete code, only ideas. Therefore, novice users can use third-party services. Naibabiji recommendshttps://openwrite.cn/Go to their website to register an account, then you can see the self-media fan growth tool in the tools section. After adding information, add the code to the website's theme file.wordpress自媒体涨粉

Method 4: Old Tribe WeChat Verification Plugin

Plugin download: http://tools.laobuluo.com/wordpress/plugins/cnwper-weixin.zip We can configure the plugin settings. 1. Developer TOKEN If we are not using the public account API interface, fill in anything here. It is recommended not to use the API, otherwise it may cause other preset automatic reply keywords to fail. 2. Public Account URL This is the QR code image of the public account we need to display on the front-end. The size should be appropriate. 3. Verification Code Retrieval Keyword This should correspond to the preset automatic reply keyword in the WeChat public account. 4. Verification Code Validity Time Generally set to 2 minutes. The unit is default. 5. Interface File Name This is a PHP file that will be generated in our website's root directory, corresponding to the return URL to be set in the automatic reply. 6. Reply Template This is generally default, but can be fine-tuned as needed. Then set up automatic replies in the public account.
<a href="http://我们的网站URL/api.php?url_captcha=get_captcha">查看验证码</a>
Publication address https://www.itbulu.com/weixin-saoma.htmlReferences:
  1. Free WordPress plugin that requires following a WeChat public account to view specified content
  2. WordPress article partial content visible only after following a WeChat public account

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: