Is there a wordpress plugin to notify users they have not visited the blog in a while
-
monsta
- Verified Member

- Posts: 1459
- Joined: March 21st, 2018, 3:37 pm
Is there a wordpress plugin to notify users they have not visited the blog in a while
The goal is to get users on the blog to be more active and comment return , is there a plugin that will email users every time they have not visited the blog in say 100 days?
- snapsuch
- Verified Member

- Posts: 300
- Joined: October 16th, 2018, 10:30 am
Have you tried emailing them thru the admin?
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
No idea about plugins. But:
So, wp doesn't track how long it's been that a user logged in, so you have to add a hook:
add_action( 'wp_login', 'user_last_loggedin', 10, 2 );
function user_last_loggedin( $user_login, $user ) {
update_user_meta( $user->ID, 'last_login', time() );
}
Then make a cron:
//* This is the cron part
if( ! wp_next_scheduled( 'tellthemtovisit' ) ) {
wp_schedule_event( time(), 'daily', 'tellthemtovisit' );
}
Then make it email after x days, let's say 100:
add_action( 'tellthemtovisit', 'tellthemtovisit' );
function tellthemtovisit() {
$users = new \WP_User_Query( [
'role' => [ 'contributor', 'author', ],
'meta_key' => 'last_login',
'meta_value' => strtotime( '-100 days' ),
'meta_compare' => '<',
] );
foreach( $users->get_results() as $user ) {
wp_mail(
$user->user_email,
__( 'Notice:', 'hi' ),
__( 'It's been 100 days, wtf?' ,'hi' )
);
}
}
So, wp doesn't track how long it's been that a user logged in, so you have to add a hook:
add_action( 'wp_login', 'user_last_loggedin', 10, 2 );
function user_last_loggedin( $user_login, $user ) {
update_user_meta( $user->ID, 'last_login', time() );
}
Then make a cron:
//* This is the cron part
if( ! wp_next_scheduled( 'tellthemtovisit' ) ) {
wp_schedule_event( time(), 'daily', 'tellthemtovisit' );
}
Then make it email after x days, let's say 100:
add_action( 'tellthemtovisit', 'tellthemtovisit' );
function tellthemtovisit() {
$users = new \WP_User_Query( [
'role' => [ 'contributor', 'author', ],
'meta_key' => 'last_login',
'meta_value' => strtotime( '-100 days' ),
'meta_compare' => '<',
] );
foreach( $users->get_results() as $user ) {
wp_mail(
$user->user_email,
__( 'Notice:', 'hi' ),
__( 'It's been 100 days, wtf?' ,'hi' )
);
}
}
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
Oh wait.. That's just with logins with subscribers. I think you can modify it to send emails on visits regardless of logging in with cookies, but the user will have to at least subscribe and log in once for the email part to work.. :p
Also, I smoked a lot and I didn't test this, so it might need some editing. idk..
Also, I smoked a lot and I didn't test this, so it might need some editing. idk..
- bill
- Verified Member

- Posts: 8259
- Joined: February 3rd, 2018, 3:36 pm
i knew that either colmike or brassy could come up with a fix
-
JamesNet
- Verified Member

- Posts: 264
- Joined: April 20th, 2018, 11:02 am
It's there and free why complicate life
-
CDSally
- Verified Member

- Posts: 452
- Joined: September 10th, 2019, 2:04 am
some miss the OP's point about users who have not posted in X number days. 
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
He said the goal was to get people to comment more, but that wasn't what he wants the plugin/code to do. At least according to the OP/title..is there a plugin that will email users every time they have not visited the blog in say 100 days?
-
monsta
- Verified Member

- Posts: 1459
- Joined: March 21st, 2018, 3:37 pm
-
CamLuCy
- Verified Member

- Posts: 461
- Joined: January 14th, 2019, 9:29 am
My blogs are all comment free, it saves me the time to delete spam posts. Who wants comments !
- cimage
- Verified Member

- Posts: 1594
- Joined: June 3rd, 2018, 2:36 pm
- Title: living the good life
Straw poll who has comments turned on at their blogs
Stop looking for reps if they don't care why waste your time and traffic at their program, fuck that.
~ cimage 2024
~ cimage 2024
-
Garry2000
- Verified Member

- Posts: 231
- Joined: May 25th, 2019, 6:21 pm
All blogs used to have them but no longer, it makes no sense to me for allowing them. As posted earlier it gets spam comments not related to the posts. So heck with it.
- BHT
- Verified Member

- Posts: 1458
- Joined: March 30th, 2018, 3:28 pm
comments on porn splogs is uncalled for, they only attract spammers.
-
Colmike7
- Banned

- Posts: 1670
- Joined: May 23rd, 2018, 12:21 pm
- Title: (>^-^)b
Yep, most of the time comments aren't going to help anything. But, there are some types of adult blogs where there are real readers and comments. But, that's kind of rare. Even videos on Pornhub get like 1-3 comments each if any..
-
GlennfromLA
- Verified Member

- Posts: 1218
- Joined: September 4th, 2019, 11:01 pm
Not for comments but an email once a couple of moths to registered users with the latest entries I do all the time.