WordPress Keyboard Shortcuts Tutorial
How to use keyboard shortcuts to moderate comments in WordPress
In WordPress it's possible to use keyboard shortcuts to manage the comments. This is designed to save you time when you have to moderate a lot of comments. Keyboard shortcuts are disabled by default. They can be enabled per user from the profile settings of that user. Some people may prefer the regular way for moderating comments. The keyboard shortcuts may be a bit confusing at first, but once you get used to them you may find it easier and quicker to use these shortcuts in managing the comments. It's a matter of choice; you can use both methods. For general information on managing comments check out the tutorial on how to manage comments in WordPress. In this tutorial we'll concentrate specifically on keyboard shortcuts.
Enabling and Disabling Keyboard Shortcuts
By default, keyboard shortcuts are disabled. They are activated per user, so you have to edit the profile of each user that you want to allow to use keyboard shortcuts. Log in to the admin panel and in case you want to active keyboard shortcuts for your account go to Users menu>Your Profile sub-menu to access the settings of your profile. If you want to allow another user to use keyboard shortcuts, click on the Users menu on the left, then in the table with the existing users that's displayed on the right click on the username of the user whose profile you want to edit. If you need more information on managing users check out the tutorial on how to manage users and user roles in WordPress.
Once you open the page with the profile settings mark the checkbox labeled Keyboard Shortcuts:
To deactivate keyboard shortcuts just unmark the same checkbox. Don't forget to click on the Update Profile button at the bottom of the page.
Managing Comments with Keyboard Shortcuts
After you have activated keyboard shortcuts you can test them. Click on the Comments tab on the left to go to the Comments section of the admin panel. As you know this will display a table with all the unapproved and approved comments (to view those in the trash or spam folders you have to click on the respective buttons above the table).
Before you can perform any action with a comment using keyboard shortcuts you have to select that comment. To do this press the j or k button of your keyboard. This will mark the first comment in the table. The selected comment will be highlighted with a light blue color:
Pressing the j button on your keyboard again will mark the next comment down, while pressing the k button will select the comment that's above the currently selected one. In short:
- j - this keyboard button moves you down the comment list.
- k - this keyboard button moves you up the list.
When you reach the the end of the current page (by default, 20 comments are displayed per page in the table) and you press the j button this will automatically open the next page and select the first comment there. Respectively, when the top comment is marked and you press the k button this will automatically move you to the previous page selecting the last comment on that page.
After you select a comment using the j and k keys you can press one of the keyboard buttons listed below to perform its corresponding action:
- a - pressing the a keyboard button will approve the selected comment (if it's unapproved).
- u - will unapprove the selected comment (if it's approved).
- s - this key will send the selected comment to the spam folder.
- d - this button will move the selected comment to the trash.
- z - this button will restore a comment that's in the spam or the trash folder and will mark it as approved. Before that, of course, you have to go to the spam or trash folder and select that comment.
- r - this will open the inline reply text area with which you can type a reply to the selected comment. Pressing the Esc button will close the reply form without saving and publishing the reply.
- q - this keyboard button will open the quick edit form. The Esc keyboard button will close it (without saving changes).
- e - this will open the edit page on which you can edit all the settings of the comment.
In addition to performing actions with individual comments you can also use keyboard shortcuts to perform Bulk Actions. As you know, each row in the table with the comments has a checkbox that corresponds to the comment listed in the row. Before you can perform the bulk action itself you have to mark the checkboxes of the comments that you want to be affected by the action. When it comes to the keyboard shortcuts, the keyboard button that's used to mark/unmark the checkbox of the selected comment is x. So before you can mark/unmark the checkbox of a comment you have to highlight it using the j and k keys. You can mark the checkboxes of as many comments as you want and then perform the bulk action itself. If you press the x button without selecting a comment before that, this will mark/unmark the checkboxes of all comments on the page.
Pretty much the same keyboard buttons are used for bulk actions as those used for actions performed to a single comment. The difference is that when performing bulk actions you have to first press and hold the Shift button on your keyboard, and while holding it press the action button (e.g. a for approving comments, u for unapproving, etc.). The only action button that differs in comparison with actions performed to single comments is the button used for sending the comments to the trash. Removing a single comment to the trash is done with the d button; for bulk actions the t button is used (while holding Shift).
So here's a reference list of the keyboard shortcuts used for bulk actions:
- x - marks/unmarks the checkbox of the selected comment.
- Shift + a (press a while holding Shift) - approves the comments with marked checkboxes.
- Shift + u - unapproves the marked comments.
- Shift + s - sends the marked comments to the spam folder.
- Shift + t - sends the marked comments to the trash.
- Shift + z - with this combination marked comments in the trash or spam folder are restored. Of course, first you need to go to the spam or trash folder, mark the checkboxes of the comments you want to restore and then press Shift + z.