Title: Simulate wordpress login?
Last modified: May 6, 2020

---

# Simulate wordpress login?

 *  [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/simulate-wordpress-login/)
 * I use the plugin WP Media Folder to sync a gallery on my website (frontend) with
   images in a specific folder (in wp-content). The sync is set at once every minute.
 * This works great but I have to be logged in at WordPress in order to let the 
   sync process work.
 * Is there any way to “simulate” a WordPress login? For example with a cronjob,
   or with a clear/preload cache action (wp-rocket)?
 * Or any other way to let the sync do his work without the need to login at WordPress?
 * Thanks very much for your help 🙂
    Alwin
    -  This topic was modified 6 years, 3 months ago by [Alwin](https://wordpress.org/support/users/wp-opti/).

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/simulate-wordpress-login/#post-12786153)
 * There is [wp_set_current_user()](https://developer.wordpress.org/reference/functions/wp_set_current_user/).
   Whether that will work in your situation depends on what process is managing 
   the sync. Usually WP scheduled events do not require users be logged in to do
   administrative tasks, but the event callback could be enforcing further restrictions.

Viewing 1 replies (of 1 total)

The topic ‘Simulate wordpress login?’ is closed to new replies.

## Tags

 * [cronjob](https://wordpress.org/support/topic-tag/cronjob/)
 * [login](https://wordpress.org/support/topic-tag/login/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/simulate-wordpress-login/#post-12786153)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
