This Page contains useful jQuery code snippets that we use.
*Note: Works for WordPress ONLY
You can add this code into WordPress in many different ways in order to keep image names from appearing on websites. This provides a cleaner more professional experience because “Logo V4 Final-Desktop" does not appear when the user hovers over the image.
Check out this plugin for an easy way to start adding code to your site: Code Snippets. Alternatively, and certainly more secure you can put this in the HTML Head of your site. There are also ways to add this code to your website via the command line but for our workflow, most things are added to the HTML head where they can easily be added or removed and everything can be seen at a glance without the need of a plugin.
Simply place this code inside your HTML head or code snippets to remove image titles:
<script> jQuery(document).ready(function($) { $("img").mouseenter(function() { let $lwp_title = $(this).attr("title"); $(this).attr("lwp_title", $lwp_title); $(this).attr("title", ""); }).mouseleave(function() { let $lwp_title = $(this).attr("lwp_title"); $(this).attr("title", $lwp_title); $(this).removeAttr("lwp_title"); }); }); </script>