When importing posts, pages, or custom posts from an existing WordPress installation, it asks you whether you want to import a user, assign to a new user, or assign to an existing user.
If you have already imported users, you want to assign all posts to existing users. However, if you have a lot of users, it can be a real pain. In my case, I had 7 imports and over 50 users per import to assign to.
Here’s a script that you can run in your inspector console to instantly fill all select options to the correct user.
First, include jQuery.
Then, run the following script:
It grabs the name from the bolded text above each select, finds the option with that text, and makes it selected.