Widgets in WordPress are very powerful — allowing a great deal of flexibility in sidebars, widgetized home pages, and footer widgets (like we have in Genesis).

Sometimes you end up with a bunch of widgets with the same title (or no title)… and it can become difficult to tell them apart. Alternatively, you may just want an internal note on a widget… that’s not shown to users.

It’d be great if this was built into WordPress… but it’s not (yet?). Nor are there hooks to enable adding a field to all widgets… so are we stuck waiting?

Not exactly: there’s a workaround.

What we’ll do is add a filter to widget titles that hides our internal notes from users… but allows it to display in the backend.

Here’s the code to add to functions.php or a functionality plugin:

Note: Make sure you change example_ to a unique prefix for your theme or site!

To use it, just prepend your widget title with your note and a pipe “|” character (SHIFT + Backslash key).

Internal Note | Widget Title

Here’s the result:

Screen Shot

 

Nick Ciske

Nick Ciske – CTO / CISO

Nick has a degree in Multimedia Design and over 20 years of experience working in web development and digital media. In his career he’s built or rebuilt just about every kind of website, including many content management systems (before WordPress), several custom e-commerce systems, and hundreds of websites.