 Thanks Ayuk. Hey guys. How are you all? Had lunch? That's nice. So, my first slide, that's me. A few years back, actually a couple of years back, when I was doing technical support, when I actually started doing technical support, I definitely didn't use WPCLI at that point. I even didn't know what WPCLI is. But today I'm here to speak about it because I think that everyone should be using that. So, if you don't know what WPCLI is or what WPCLI beast is, don't worry. We are going to talk about it and you will know. Before we know about it, I would like to introduce myself. My name is Aditya Shah and I'm a software engineer. I currently manage the hosting support team, WPMEDF. We make plugins for WordPress as well as hosting. I'm also the founder or you can say the meetup organizer for WordPress Bhopal community. I'm working with WordPress for more than 10 years now. That's all about me. So, we can just proceed with WPCLI because we have got a limited time. So, some questions. What WPCLI is? Why WPCLI? This is for, who can use it? And what would you need to use WPCLI? Let's start then. So, what is WPCLI? It's a command line tool to use WordPress by utilizing the command line or the terminal that you have in your laptop or your computers. For example, you want to bulk update a lot of posts. So, you can just write a simple command and you can update all of the posts. Or you want to install plugins, you can just write a single command and the plugin will be installed for you. So, we'll see what, how, why and everything. So, why WPCLI? First reason is when you want to migrate site, you can make good utilization of WPCLI. Like the couple of things, for example, when you want to migrate site, you want to transfer all of the files, then you want to transfer the database. So, WPCLI makes it very easy because you have got SSH access normally and you can just zip the files and export the database and transfer it directly. So, when it comes to transferring files and database, you can do it without WPCLI as well. But then it's tough because you need to learn a lot of Linux things. For example, MySQL and then different, different things, right? So, when it comes to WPCLI, you can use a simple command like WPDB export, which will export the database for you. And then you can zip the files and just transfer it somewhere like with a WGIT and like install it with WPDB import. So, that's how you can just quickly migrate a site, right? Second reason is performing fewer steps. Like, for example, when we were talking about migration, when we used to migrate a site previously, we have to use a file manager or like SSH for zipping the files. And then we had to go to PHP MyAdmin to export the database and then we had to transfer and import, like, going to different steps to open those applications. But when it comes to WPCLI, you can just do like three commands and like you are done. So, it takes fewer steps. I'll also give some more examples of how it takes fewer steps. Next one is it actually gives better control of what you can do. We can talk about it again later on. Then it comes to background jobs. So, for example, you want to do some sort of activity. For example, you want to compress images on your website. It actually requires you to go to the UI and then turn on the optimizations and you have to stick to that page or something like that. But when it comes to WPCLI, you can just run a command and screen and then forget about it. And it will just run in the background and that's done, right? So, next thing, who this is for? What are you guys? Some might be developers. Some might be engineers. Some might be support engineers. Some might be server administrators. Or you might be a site administrator. You just have a single site, right? So, when it comes to support engineers, it reduces a number of steps. For example, again, like a customer comes to you, ask, like, can you export the database for me? Instead of asking them for access of their hosting site or, like, then navigating because, like, every host has a different host, right? So, you have to search for that specific setting where how you can open PHP My Admin or how you can establish connection to access their database. You can just ask for SSH access, go to their, like, log into SSH and run a WPDB export and that's it. That's how support engineers do things. Then it comes to server administrators. So, it is helpful because you can perform a lot of activities. For example, you have got a website where it is infected with malware and you want to do multiple steps like you want to replace the WordPress core, you want to replace all of the files that are plugins, you want to replace all of the themes, you want to replace or you want to, like, delete all of the extra files that might be there. So, what you can do is you can make a bash script and you write all of the commands there in the bash script and run that bash script. So, it will automatically do all of the things for you. So, that's how things are done by server administrators because, like, they know bash. But, like, a site administrator or, like, normal people don't know that. So, yeah, that's how they can be benefited from it. Next is site administrators. Like, I have got single site. What I can do about it. Like, how can WPCLI benefit me? So, remember, anyone remembers? You might have forgotten your WP admin username and password? Yep. So, or maybe just password or anything. So, what you can do is SSH into the server, run a simple command, like WP user list. It will list down all of the users. So, that way you know who is the administrator, who is the editor. So, remember, like, this is my username. Now, when you forgot your password, you had to go to PHP MyAdmin, go to the user stable, and then change the password from there. So, instead of learning all of these steps, you can run a simple command, WP user update. Then you can give the parameters, like, to change the new password, just specify new password, and that's changed for you. Then you can just log in with that username and password. So, that's how you can benefit out of this WPCLI. There are plenty of examples, but I don't think that we can really cover all of them here. So, that's one. And I think that's that. No. So, let's get started. Like, when you say, like, you don't know or you want to start with WPCLI, you just have to install WPCLI on your server or your computer when you want to use it. So, what it requires, it requires Unix-like environment, or Linux, or Windows, or whatever. Well, and it requires WordPress, it requires PHP. Well, there are basically just single commands that you can find on the WPCLI.org. Just one single W get command, and as soon as you copy and paste that command in your command line, it will just get installed. That's that you don't need to do anything else. It's that easy. Now, talking about how to run commands, like, I have installed the WPCLI now, what? So, every WPCLI command starts with WP as the keyword. Then the command comes. For example, I said WP user list. So, WP is WPCLI. And then the command user is the command. Then there is sub-command. So, I said WP user list. So, I want to list all of the users. So, command is the user. And list is the sub-command. Now, this should be listing all of the users, right? But then I might want to specify some more parameters to it. For example, I want to list down only the administrators. So, what I'll do is WP user list, type equals to administrator. So, similarly, like, this is how the commands work. Next one. So, like, I was telling you about parameters, parameters and values. So, parameters, when it comes to commands, sub-commands and parameters. So, parameters are required. Then I said, like, hyphen hyphen thing. So, when it comes to, you want to know only the administrators or the editors. That is optional. Like, if you want to specify things or not, then it comes to some parameters might require values. For example, if you want to change the password, then you might need to specify the password that I want this specific password. So, that might be with value or without values. Now, we were talking about WP core. Like, you want to re-download WP core or you want to just download WP core. So, you can do it with WP core download. Again, there are some more parameters to it. WP core download. Then you just want to skip all of the themes and plugins that comes with WP core. So, you can specify hyphen hyphen and skip hyphen content. So, it will download just the WP core without themes and plugins. That's how the core commands work. Then it comes to database commands. Those might be WPDB export, like I said, and you can specify the export file name. Then similarly, we have the import command, WPDB import, and specify which file you have to import. So, that's WPDB import and the file name. So, it will just import the whole database. And then, there's a tool called MySQL, right? So, if you want to run any MySQL commands directly into the WPCLI, you can use WPDB CLI. It will open the MySQL console and you can run the actual MySQL commands over there. Then there's a search and replace thing. So, ever encountered a thing like you want to change the domain of your site. So, like for example, my site was adityashar.com and I want to change it to adityashar.me. So, what I'll do is I'll run a search and replace command. So, WP, because WP. Search, hyphen, replace. Okay, I'll just do it quickly. Can you give me one moment? So, search replace is like just specify the original URL and the destination URL like adityashar and then adityar.me. And it will just do the search and replace for me. I guess we don't have time, so I'll just skip post media and create users for now. But I can talk about this and just quickly. So, I was telling you about bash command. So, we can write bash scripts to specify what all actions are need. Similarly, we can write these loops in bash. I can specify how many times I want to iterate a single command and then it can do things for me. Like for example, if I see this one, it will specify the site list. For example, if you have multi-site, you can specify all of the multi-site subsites. For example, like I don't think there's an example, but like if you have a multi-site and you have hundreds of sites, you can specify that this for loop and it will list down all of the subsite URLs. And well, the WP post list URL is this, format count. So, for example, I want to count all of the number of subsites so it can just count the number of subsites and it will just give the number. Questions? I don't think we have time, but if you have any questions, I will be outside and we can talk about it. And let's connect. Thank you. Thank you.