Working with WordPress on a daily basis I found or created many snippets that make maintenance easier, user experience better both for authors and visitors, or the website more flexible and secure. In the previous collection I shared six useful hacks and snippets for inserting ads, social sharing and security.
Today I’d like to share a few more of the simple tricks that will improve the security and user experience (both for visitors and staff) of your WordPress site.
Prevent WP from adding links to images
Add this piece of code to your theme’s functions.php file to disable the default linking when adding images. Note, this will not remove the existing links, just change the behavior when you add images.
Via WP Beginner
Disable comments for media (images)
Spammers just love to exploit these and when neglected you can get a huge amount of junk in your database. Unfortunately, from the media menu you can’t edit settings for all items comments at once, so you’re left with the frustrating job of changing one by one.
Luckily, there’s also this piece of code that disables all media comments.
Via WpBeginner
Replace WP logo with your own on WP-login
This one is not that useful, but it’s cool, and if you build websites for clients, they’ll love it!
Via ElegantThemes
See also: Customizing the Login Form, How to Create a Stunning Custom WordPress Login Page
Add async and defer to javascript load
This little function is useful for enhancing user experience and SEO through reducing page loading time. It tells the javascripts to defer and load asynchronously, without stopping the HTML parsing.
Via Emoticode
Remove script and css versions and meta generator
These two functions make your WordPress installation a bit less obvious and, by hiding the version of your scripts and styles, a little harder for hackers to plan the attack.
One response to “More cool WP hacks and snippets to improve UX and security”
Thanks for sharing, It work!