最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Automatic chage password of pages after some time

programmeradmin1浏览0评论

Hello any idea how to make a page I publish to chage the password after 2 days automatically (I am looking for a plugin or something else I can implement)? Right now I am using the pages to present something to my clients but then I want to not have access to it after 2 days. Thank you.

Hello any idea how to make a page I publish to chage the password after 2 days automatically (I am looking for a plugin or something else I can implement)? Right now I am using the pages to present something to my clients but then I want to not have access to it after 2 days. Thank you.

Share Improve this question asked May 12, 2020 at 7:55 GeorgeMatGeorgeMat 1
Add a comment  | 

1 Answer 1

Reset to default 0

Welcome to WPSE. Plugin recommendations are considered off-topic here, so here's an action approach to the problem.

You could use WP Cron to schedule a daily event for resetting page password. You can use wp_schedule_event() to schedule your custom event.

In your event callback, use first WP_Query with password parameter to get all protected pages. Then loop through found pages and update their passwords with wp_update_post as password is saved in the post_password post property / posts table column.

If you want the new password to be something random, you can for example use wp_generate_password() to generate it.

发布评论

评论列表(0)

  1. 暂无评论