5 WordPress hacks you should know and implement today!
1. Use Shortcodes
Shortcodes help you quickly add any kind of functionality to your WordPress site. For example, you can add forms, galleries, videos, audio, and more using one simple code.
[form id="123"]
To learn more about using shortcodes, check out WordPress’ official documentation.
2. Optimize Images
Images can really slow down your site if they’re not optimized. Use a plugin like WP Smush to compress images and improve load times.
// WP Smush
function wpb_image_editor_default_to_gd( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );
For more tips on optimizing your site, check out BeginnerTuts’ guide to WordPress hosting.
3. Use WordPress Themes and Plugins
There are thousands of free and premium themes and plugins available for WordPress. Using them can save you time and money, especially if you’re not a developer.
//example plugin
function my_plugin_function() {
// Code goes here
}
add_action( 'wp_footer', 'my_plugin_function' );
To find themes and plugins, check out the WordPress Theme Directory and the WordPress Plugin Directory.
4. Use Keyboard Shortcuts
If you’re working in the WordPress admin area, keyboard shortcuts can save you a lot of time. For example, use CTL + ALT + N to create a new post or page instantly.
// CTRL + ALT + N shortcut
jQuery(document).ready(function($) {
$(document).keydown(function(event) {
if((event.ctrlKey || event.metaKey) && event.altKey && event.which == 78) {
event.preventDefault();
wp.media.editor.open('post');
}
});
});
For more WordPress keyboard shortcuts, check out WP Beginner.
5. Enable Caching
Enabling caching can improve your site’s load times by storing frequently accessed data. Use a plugin like WP Super Cache to enable caching on your site.
// WP Super Cache
function wpb_default_admin_color($color_scheme) {
if (is_admin()) {
global $_wp_admin_css_colors;
if (isset($_wp_admin_css_colors[$color_scheme])) {
return $color_scheme;
}
}
return 'ectoplasm';
}
add_filter('get_user_option_admin_color', 'wpb_default_admin_color');
For more tips on improving your site’s speed, check out WP Engine’s guide to speeding up your WordPress site.
Written by: Steven Iversen 18-06-2023 Written in: Wordpress Tutorials



