New Gravity Form at the same ID

I’m doing a lot of work on the Parallel Practice site. We made some really significant changes to the form. Naturally, I did that on my development site. I had a vague premonition about getting those changes over to production but figured there’d be some way.1 Many things I did rely on the Gravity Form ID being 1. It impacts how I name certain CSS classes. It determines how I target fields via javascript, and how things get processed in PHP. I could definitely search and replace it throughout my code but I felt like that was begging for lots of minor issues that would be a real hassle to figure out. I could also hand change the form on the production site. That also felt like a real pain with plenty of opportunities to mess up stuff. After looking around a bit and not finding any good advice, I decided I’d just try editing the database directly. There are two tables to look at wp_gf_form and wp_gf_form_meta. You may have a prefix other than wp if you set up something custom. wp_gf_form just has the basic title and ID. I didn’t need to change anything here but it’s nice to take a look at the data. Now I open my production database and development database so I can compare […]

Screenshot indicating this user has several hundred sites associated with their account.

So Many Sites – Cleaning Up Users

There are lots of ways users can end up associated with many sites in a WordPress multisite install. That’s no big deal if it’s only five or ten but sometimes it’s way more. It’s not just messy, it actually degrades performance when you’re logged in because the admin menu bar loads all those sites. This can really become a drag as you pass a hundred or so sites. Previously, I’ve just given up on the user and made a new one. I’ve also gone through https://theSite.us/wp-admin/network/users.php and opened up a number of sites and removed the user from each one manually. That’s a pretty awful pattern but being in a hurry leads to all sorts of bad choices.1 Today I got the request to remove around six hundred sites from a particular faculty member. The request coincided with time and mental bandwidth so I opted to do this in an intelligent way. There was also no way I was going to do this by hand. First step would be to get the user’s id from the wp_users table. You can look up users here by user_login or user_email and get to what you need pretty quickly. If you’re using Sequel Pro rather than the terminal don’t forget to restrain your searches by the right field. For this example, we’ll pretend […]