How to Bulk Delete Menu Items in WordPress

Bulk delete menu items in WordPress – WordPress has a very easy to use and drag and drop user interface to quickly add menu items. The menus feature in WordPress allows you create a good site structure while letting users navigate and find information as needed. The good thing is, you can easily add as many menu items you want. The annoying thing is, there are no options to bulk delete menu items in WordPress.

Why Bulk Delete Menu Items?

It may not be every time, but there will situations where you need to delete multiple menu items. Sure, you can manually delete each and every menu item by simply expanding it and then clicking on the link “Remove.” However, if you have quite a few menu items, it can be a pain in the back to delete all of them manually. This is especially true in scenarios like when you import demo data for your theme or when you are cleaning and organizing the menu.

For instance, look at the below image. There are a ton of menu items that are automatically added when I imported the demo data of a WordPress Adsense theme. Trust me, what you see in the below image are just half of the menu items. As you can tell, it will be pretty frustrating to delete to all those dummy menu items one by one.

Bulk Delete Menu Items in WordPress

1. Though WordPress didn’t have built-in options to bulk delete menu items, you can use a simple and free plugin to do that. To start off, search for “Quick Remove Menu Item” in the Plugins page (Plugins > Add New) and then click on the button “Install.”

Do you know you install a plugin in multiple ways? Here’s how to install WordPress plugin in 3 different ways.

2. Once installed, click on the button “Activate” to activate the plugin. After activating the plugin, you can proceed to delete the menu items. To do that, open the Menus page by navigating to “Appearance > Menus” in the WordPress dashboard.

3. In the Menus page, select the menu you want to edit from the drop-down menu and then click on the button “Select.” In my case, I want to edit my Primary Menu. So, I selected it from the drop-down menu.

4. Now, you will see all the menu items in that particular menu.

  • To delete a single menu item, simply click on the “X” icon.
  • If you want to delete a menu item with all its sub-menu items then click on the “XX” icon.

When you click on the icon, you will not receive any warning message or confirmation message, but the menu will be deleted.

5. Once you are done deleting the unwanted menu items, click on the button “Save Menu” to save the changes.

That’s all there is to do and it is that simple to bulk delete menu items in WordPress. Do comment below sharing your thoughts and experiences about using the above method to delete menu items in WordPress.

How to Add Custom CSS Classes to WordPress Widgets

Add CSS classes to WordPress widgets – The best thing about WordPress is that it makes it very easy to customize your site to meet your needs. One of the popular ways to customize a WordPress site is to use a good WordPress theme. If you are using WordPress for any part of time, you will know that most themes and plugins make a good use of the WordPress widgets to display content on the front end.

As such, there will be times when you need to add custom styles to WordPress widgets. Thankfully, you can easily add your own custom styles by adding custom CSS classes to WordPress widgets. In case you are wondering, here’s how to add custom CSS classes to WordPress widgets.

Add Custom CSS Classes to WordPress Widgets

To add custom CSS classes to WordPress widgets we are going to use a free plugin called Widget CSS Classes. As the name implies, this simple plugin makes it is really easy to add custom CSS classes and IDs to WordPress widgets. This, in turn, enables you to add custom styles to WordPress widgets.

Why not use a minimal theme for your website? Here are some of best AdSense optimized WordPress themes.

Features of Widget CSS Classes

Though the plugin is pretty simple and minimal, Widget CSS Classes has all the features you’ll ever need to quickly and easily add custom CSS classes to WordPress widgets. Below are some notable features of the plugin.

  • Plugin adds custom fields to widgets to add CSS classes
  • Along with CSS classes, you can also add CSS IDs
  • Adds automatic even and odd classes to widgets
  • Ability to add multiple classes
  • Ability to add predefined classes using checkboxes
  • Add automatic numbered classes to widgets
  • Support for hooks and filters to customize the output

Add Custom CSS Classes Using Widget CSS Classes

To add custom CSS classes to widgets in WordPress, download and install Widget CSS Classes plugin like any other WordPress plugin. Once installed, activate the plugin to start adding CSS classes to WordPress widgets.

The good thing about the plugin is that it is optimally configured out-of-the-box. All you have to do is set the CSS classes in the widgets section. To do that, navigate to “Settings” and then “Widgets“.

Add CSS Classes to Widgets - Select Widgets

Add CSS classes to widgets – select widgets

Once you are here, expand the widget and you will see a new field called “CSS Classes“. Here, enter your custom CSS class and click on the “Save” button to save the changes.

Note: if you want to, you can enter multiple CSS classes by separating them with a single space. Ex: “widget-class-1 widget-class-2”

Add CSS styles to Widgets - Enter Custom CSS Class

Add CSS styles to widgets – Enter custom CSS class

That’s it. With the above action, you’ve successfully added a new custom CSS class to a WordPress widget. In fact, if you open Inspect Element tool in Chrome web browser(Menu > Tools > Developer Tools) and see your widget, you will see the newly added CSS class.

Add custom CSS classes to WordPress widgets - CSS classes added to widgets

Add custom CSS classes to WordPress widgets – CSS classes added to widgets

From now on, you can use this custom CSS class to add custom styles to the target WordPress widget.

What you increase your AdSense ad revenue? Here’s how to insert AdSense ads within the post content.

Add Custom Styles to Widgets – Plugin Settings

As I said in the features list, the plugin also adds a few other automatic classes like even and odd classes and numbered classes. If you look carefully at the Inspect Element image above, you will those extra classes added by the plugin.

However, if you want to, you can easily disable these extra classes from the plugin settings page. To open the plugin settings page, navigate to “Settings > Widget CSS Classes“.

Add custom styles to widgets - Open plugin settings

Add custom styles to widgets – Open plugin settings

You can configure a few settings from this page. Here are what those settings mean.

  • Add widget number classes: As you can tell from the name itself, this setting adds numbered classes for all the widgets. Ex: widget-1, widget-2, etc. This option is enabled by default.
  • Add First or Last Classes: This options automatically adds class to the first and last widget.
  • Add Even or Odd Classes: This setting automatically adds two classes. i.e, “widget-even” and “widget-odd” to even and odd numbered widgets respectively. For instance, for the first widget in the sidebar, “widget-odd” class will be added, for the second widget, “widget-even” class will be added, for the third widget, “widget-odd” class will be added, and so on.
  • Show Additional Field for ID: Using this option you can enable addition field in the widgets to add custom CSS IDs. This option is disabled by default.
Add custom CSS classes to WordPress widgets - Plugin settings

Add custom CSS classes to WordPress widgets – Plugin settings

If you enable the additional field for CSS IDs, this is how it appears on the widgets page. In the new additional field, enter your target CSS ID and click on the button “Save” to save the changes.

Add custom styles to WordPress widgets - Add CSS ID

Add custom styles to WordPress widgets – Add CSS ID

You can also add your own custom predefined classes so that you don’t have to enter a single or multiple CSS classes multiple times for all your widgets. To add predefined classes, simply enter the CSS class name in the field next to “Predefined Class” and click on the “Save Changes” button.

Add custom CSS classes to WordPress widgets - Add predefined classes

Add custom CSS classes to WordPress widgets – Add predefined classes

After setting up the predefined classes, you can select those classes while configuring the widgets.

Add custom CSS classes to widgets - Select predefined classes

Add custom CSS classes to widgets – Select predefined classes

Finally, you might be thinking what does the “Class Field Type” setting do. Below is what each option does.

  • Text: This option is selected by default and it displays a simple text field to add CSS classes. In fact, this option is what enables you to add custom CSS classes while configuring your WordPress widgets.
  • Predefined: When selected, you will see checkboxes in the widgets so that you can select which predefined CSS classes to apply.
  • Both: This option shows both the text and predefined fields in the widgets.
Add CSS classes to WordPress widgets - When select the "Both" option

Add CSS classes to WordPress widgets – When select the “Both” option

  • Hide: This option hides both the text and predefined fields in the widgets.

Last but not least. You can export and import Widget CSS Classes settings from the Import and Export tab. This is pretty helpful when you want to backup the settings or to use the same settings and options on multiple WordPress sites.

Custom CSS classes to widgets - Import and Export options

Custom CSS classes to widgets – Import and Export options

Promoting affiliate products? Here are some of the best plugins to cloak affiliate links.

Wrapping Up

As you can see, the plugin makes it easy to add custom CSS classes to WordPress widgets. Moreover, the plugin is very easy to use, minimal, and optimally configured by default. So, do give the plugin a try and add your own custom styles to WordPress widgets.

If you like this article, do check out how to disable theme switching in WordPress and how to disable plugin and theme editor for better WordPress security.

Hope that helps and do comment below sharing your thoughts and experiences about using the above method to add CSS classes to WordPress widgets.

How to Create An Admin User in WordPress Using MySQL

Create an admin user in WordPress using MySQL – In my other WordPress how-to article, I’ve shown you how to create an admin user via FTP with a simple functions file code snippet. This method is particularly useful when you forgot WordPress password and cannot recover it in traditional methods.

Besides from using FTP, you can also create an admin user in WordPress using MySQL pretty easily. Just like the FTP method, this approach is helpful when you are facing WordPress login problems. In case you are wondering, here is how to do it.

Things You Need to Know Beforehand

You need to have access to your hosting control panel and your MySQL database. Typically most hosting providers use cPanel as the hosting control panel and phpMyAdmin to manage WordPress database. So, I’m using the same to create an admin user in WordPress via MySQL.

Even if your control panel is different or using some other software to manage MySQL, the process should be pretty similar.

Note: Before proceeding any further, make sure that you backup WordPress database. This helps you to restore the database if anything happens in the process.

Create An Admin User in WordPress Using MySQL

1. To create an admin user in WordPress using MySQL, login to your hosting control panel, find and click on the phpMyAdmin option to open phpMyAdmin. Typically, you can find the phpMyAdmin link in the Databases section in the cPanel.

Using phpMyAdmin we are going to edit wp_users and wp_usermeta tables to create an admin user in WordPress using MySQL.

Create an Admin User in WordPress using MySQL - Select phpMyAdmin

Create an Admin User in WordPress using MySQL – Select phpMyAdmin

2. In the phpMyAdmin window, select your database appearing on the sidebar.

Create an Admin User in WordPress using MySQL - Select Your Database

Select Your Database

3. The above action will open the database. click on the link wp_users appearing on the sidebar.

Create an Admin User in WordPress using MySQL - Select wp_users Table

Select wp_users Table

4. Once the table has been opened, click on the option “Insert” appearing on the upper navigation bar.

Create an Admin User in WordPress using MySQL - Click Insert in wp_users Table

Create an Admin User in WordPress using MySQL – Click Insert in wp_users Table

5. Now, enter the fields as described below:

  • ID — In this field, enter a number of your choice. In my case, I’ve entered “5”. Remember this number, we are going to enter it a couple more times in other areas.
  • user_login — Enter a username of your choice. I’ve chosen “user5” as my username.
  • user_pass — Select “MD5” from the drop-down menu and then enter a strong password in the next field.
  • user_nicename — Enter your nickname in this field.
  • user_email — Enter the email address you’d like to associate this account with.
  • user_url — You can enter a web address of your choice in this field.
  • user_registered — Enter the date and time when the user is registered.
  • user_activation_key — Leave this field blank for now.
  • user_status — In this field, enter “0”.
  • display_name — Enter your name in this field. This will be displayed on your WordPress site.

6. Once you are done filling up the details as described, click on the button “Go“.

Create an Admin User in WordPress using MySQL - Fill wp_users fields

Create an Admin User in WordPress using MySQL – Fill wp_users fields

After editing the wp_users table, we can proceed to edit wp_usermeta table. Just like before, all we have to do is add a few values to complete the process of creating an admin user using MySQL.

7. To do that, click on the link “wp_usermeta” link appearing on the sidebar.

Create an Admin User in WordPress using MySQL - Select wp_usermeta Table

Select wp_usermeta Table

8. After opening the wp_usermeta table, click on the option “Insert” appearing on the upper navigation bar.

Create an Admin User in WordPress using MySQL - Select wp_usermeta Table Insert Option

Select wp_usermeta Table’s Insert Option

9. Now fill in the fields as described below:

  • unmeta_id — Leave this field empty.
  • user_id — Enter the ID you’ve entered earlier. In my case, I’ve entered “5” earlier.
  • meta_key — Enter meta key as wp_capabilities.
  • meta_value — Insert a:1:{s:13:"administrator";s:1:"1";} as the meta value.

On the other row, fill the blanks like below:

  • unmeta_id — Again, leave this field empty.
  • user_id — Enter earlier user ID. In my case, that will be “5”.
  • meta_key —  Insert wp_user_level in this field.
  • meta_value — Enter “10” in the field.

Once you are done filling up the details, this is how it looks like. Click on the button “Go” to save the changes.

Create an Admin User in WordPress using MySQL - Fill wp_usermeta Fields

Create an Admin User in WordPress using MySQL – Fill wp_usermeta Fields

10. That’s all there is to do. You’ve successfully created an admin user in WordPress using MySQL. In fact, you can log in with this username and password you used in this procedure.

Once logged in, you can reset the password of the other account, modify, or remove the user account by navigating to “User > All Users” in the WordPress dashboard.

Create an Admin User in WordPress using MySQL - Admin User Account Created using MySQL

Admin User Account Created using MySQL

If you like this simple guide, you might also like how to change database prefix and how to change WordPress database name. Do check them out for improved WordPress security.

Hope that helps and do comment below sharing your thoughts and experiences about using the above method to create an admin user using MySQL.

How to Backup WordPress to Google Drive for Free [Detailed Guide]

Backup WordPress to Google Drive – No matter what WordPress website you are running, creating regular backups on your local computer or on a cloud storage service is a mandatory task. As a website owner, you should never ignore it. Of course, many web hosts like SiteGround and WP Engine offer their own automated daily and/or weekly backups, but you just cannot have a single backup location that is not fully under your control.

That is the reason why many WordPress backup plugins offer features that can automatically backup your WordPress site to Dropbox, Google Drive, and many other cloud services. So, in this quick and detailed guide, let us get to know how to backup WordPress site to Google Drive in simple and easy steps.

Why Backup to Google Drive?

The arguments to backup WordPress to Google Drive are simple and straightforward.

  • With every Gmail account, you get 15GB for free Google Drive cloud storage space.
  • Highly reliable cloud service. The chance of losing your backup is quite low. Unless it is your deliberate mistake.
  • Highly secure service.
  • You can access and download your backups whenever and wherever you want.
  • If you want to, you can share your backups between your team.

Backup WordPress to Google Drive

To backup WordPress to Google Drive, we are going to use a plugin called UpdraftPlus. It is a free plugin available from the WordPress plugin repository. The good thing about UpdraftPlus is that you can configure it to automatically backup WordPress to Google Drive on scheduled time.

Features of UpdraftPlus Plugin

Some of the features of UpdraftPlus include but not limited to:

  • The plugin can backup your site to a wide variety of cloud storage services, including Google Drive
  • Automatic backup with scheduling
  • Quickly restore both files and database
  • Ability to select which files, folders, and components to backup and restore
  • Download backup archive from WordPress dashboard
  • Ability to encrypt database while backing up [pro feature]
  • Options to duplicate or migrate your WordPress site
  • Remote control backups of other sites from a single WP dashboard (useful feature if you have multiple WP websites)
  • Slipt backups into multiple archives for large sites

and much more.

Note: though the process of setting up UpdraftPlus to backup WordPress to Google Drive is a bit lengthy, it is pretty simple and straightforward. I’ve divided the whole setup procedure into small sections and several steps. So, follow the steps and you should be able backup your WordPress site to Google Drive in just a few minutes.

Install and Active UpdraftPlus

1. To start off, download and install UpdraftPlus like any other WordPress plugin.

Backup WordPress to Google Drive - Install UpdraftPlus

Backup WordPress to Google Drive – Install UpdraftPlus

2. Once installed, activate the plugin and you are good to configure it to backup WordPress to Google Drive.

Backup WordPress to Google Drive - Activate UpdraftPlus plugin

Backup WordPress to Google Drive – Activate UpdraftPlus plugin

3. After activating the plugin, open up the UdraftPlus settings page by navigating to “Settings” and then “UpdraftPlus Backups.”

Backup WordPress to Google Drive - Open UpdraftPlus Settings Page

Backup WordPress to Google Drive – Open UpdraftPlus Settings Page

Setup the Schedule and Select Storage

4. In the settings page, navigate to the “Settings” tab. Here, we need to set up the automatic backup intervals for both the files and database.

Backup WordPress to Google Drive - Schedule UpdraftPlus

Backup WordPress to Google Drive – Schedule UpdraftPlus

5. Simply select the backup frequency from the drop-down menu and enter how many backups you want to retain. In my case, I’m selecting the “Daily” option as the backup interval and “10” backups to retain. Which simply means that the plugin will backup my WordPress site daily and retains 10 backups at any given point of time.

6. Now, scroll down and select your backup destination as “Google Drive” next to “Choose your remote storage.” This action will bring forward some extra options and also gives you the “authorized redirect URI,” we are going to need that URI in future steps.

Don’t yet save the changes.

Backup WordPress to Google Drive - Select Google Drive

Backup WordPress to Google Drive – Select Google Drive

Configuring Google Drive

Before UpdraftPlus can backup WordPress to Google Drive, you need to configure Google Drive to activate Drive API and get the Client ID and secret key.

7. To do that, head over to the Google Developer Console. Here, click on the button “New Project.”

Backup WordPress to Google Drive - Create a new project

Backup WordPress to Google Drive – Create a new project

8. Now, enter the new unique project name and click on the button “Create.” For instance, I’ve entered my project name as “Bloggersignal Dev.”

Backup WordPress to Google Drive - Enter your new Project name

Backup WordPress to Google Drive – Enter your new Project name

9. After creating the Project, head over to the “APIs” section under “APIs and auth” on the left sidebar.

Backup WordPress to Google Drive - Select the APIs link

Backup WordPress to Google Drive – Select the APIs link

10. Here, find the “Drive API” link under “Google Apps APIs” and click on it.

Backup WordPress to Google Drive - Select Drive API

Backup WordPress to Google Drive – Select Drive API

11. Now, click on the “Enable API” button. This action enables the Drive API.

Backup WordPress to Google Drive - Enable the Drive API

Backup WordPress to Google Drive – Enable the Drive API

12. After that, you need to configure the Consent Screen. To do that, click on the link “Consent screen.” Here, enter the Product Name of your choice and click on the “Save” button.

Of course, you can also fill all the optional blanks if you want to, it doesn’t matter.

Backup WordPress to Google Drive - Configure Consent Screen Settings

Backup WordPress to Google Drive – Configure Consent Screen Settings

13. Now, you need to create the client ID. To do that, click on the link “Credentials” in the left sidebar. Once the page has been opened, click on the button “Create new client ID.”

Backup WordPress to Google Drive - Select Create New Client ID

Backup WordPress to Google Drive – Select Create New Client ID

14. This will open up the “Create Client ID” module. Here, enter the details as follows.

  1. Select the radio button “Web Application.”
  2. Enter your full domain name (eg: http://www.example.com) in the “Authorized Javascript Origins” field.
  3. Now, copy the authorized redirect URL from the UpdraftPlus settings page and paste it in the “Authorized Redirect URIs” field.

15. Once you are done filling the fields, this is how it looks like. Now click on the button “Create Client ID.”

Backup WordPress to Google Drive - Create New Client ID

Backup WordPress to Google Drive – Create New Client ID

16. This action will create the new client ID and client secret. Now, copy both the client ID and the client secret.

Backup WordPress to Google Drive - Copy client ID and client secret

Backup WordPress to Google Drive – Copy client ID and client secret

Configure UpdraftPlus to Work with Google Drive

17. Now paste those two in the UpdraftPlus settings page next to “Google Drive Client ID” and “Google Drive Client Secret.”

Backup WordPress to Google Drive - Paste client ID and client secret

Backup WordPress to Google Drive – Paste client ID and client secret

18. After that, simply scroll down and click on the “Save Changes” button to save all the changes you just made. This action will show you a notice indicating that you need to authenticate your Google Drive account. Just click on the link.

Backup WordPress to Google Drive - Authorize UpdraftPlus

Backup WordPress to Google Drive – Authorize UpdraftPlus

19. The above action will open the authorization or consent window. Click on the button “Accept” to allow UpdraftPlus to upload files to your Google Drive account.

Backup WordPress to Google Drive - Accept to Authorize UpdraftPlust

Backup WordPress to Google Drive – Accept to Authorize UpdraftPlust

20. You’ve successfully authorized UpdraftPlus to backup WordPress to Google Drive. From this point forward, UpdraftPlus will automatically backup WordPress to Google Drive as scheduled.

Backup WordPress to Google Drive - UpdraftPlus Authorized Successfully

Backup WordPress to Google Drive – UpdraftPlus Authorized Successfully

21. To test the settings, navigate to the “Current Status” tab and click on the button “Backup Now.”

Backup WordPress to Google Drive - Click on the Backup Now Button

Backup WordPress to Google Drive – Click on the Backup Now Button

22. This action may open another screen, just click on the button “Backup Now” again.

Backup WordPress to Google Drive - Click on the Backup Now Button Again

Backup WordPress to Google Drive – Click on the Backup Now Button Again

Wrapping Up

That’s it, UpdraftPlus will now backup your site and automatically uploads it to your Google Drive account. Depending on the size of your site, the backup and upload process may take some time.

Backup WordPress to Google Drive - Backup in Progress

Backup WordPress to Google Drive – Backup in Progress

Once the backup and upload process has been completed, you can view all the current backups in the “Existing Backups” tab.

One thing to keep in mind is that since UpdraftPlus is uploading the backup files to your Google Drive account, it will not store any files locally. i.e, on your server.

So, make sure that you check the backups in your Google Drive account.

Backup WordPress to Google Drive - Backup Completed

Backup WordPress to Google Drive – Backup Completed

That’s all there is to do and it is that easy to configure and use UpdraftPlus to backup WordPress to Google Drive.

Hope that helps to properly backup your WordPress site to Google Drive. Do comment below if you face any problems following the above procedure or to share your thoughts and experiences about using UpdraftPlus to backup WordPress to Google Drive.