Widgets in WordPress

Widgets are one of the oldest functionalities available in WordPress. These are small modules that allow you to add various dynamic elements to your website. For example, the Tag Cloud widget will display the tags used on your website. You can add it to the footer or sidebar, for example. The location of widgets depends on the structure of the theme – we add them differently in themes based entirely on the Gutenberg block editor, and differently in classic themes.

The role of widgets on the website

Widgets can play different roles in WordPress. Here, we can list, for example:

  • adding functionality: adding a calendar, search engine, latest entries and others,
  • customizing the appearance of the page: adding graphic elements, adding additional text,
  • improving UX: facilitating navigation through lists of categories, archives or tags,
  • integration with external services: widgets for social media.
  • Areas of use of widgets
  • Where we can add a widget depends on the structure of the theme.

Themes based on the classic structure, without a block editor, have a separate widget section in the Appearance > Widgets section. Adding a widget is only possible in the area that the theme creator has customized for this purpose.

The older look (which can be enabled with the Classic Widgets plugin) allowed you to drag widgets from the list on the left to a given area on the right. The widget list often included additional elements that were added together with the installation of the theme or plugin.

The newer look is based on the use of blocks – we simply add a block in a given area.

By default, we can choose from Archives, Calendar, Category List or Search.

The change from classic widgets to new ones happened with version 5.8 of WordPress and was quite a revolution. However, despite the passage of time, these new widgets, based on the block system, can still cause problems in older types of themes. So sometimes installing the Classic Widgets plugin is necessary to use all the functions of the theme.

In the case of block themes based on Gutenberg, we add the widget directly in the theme editor. The difference is that we no longer have imposed areas, such as the sidebar or footer.

How to use widgets

Widgets are best used where they will really improve the operation of our site. Historically speaking, widgets were used to improve the blog – adding the ability to browse the archive or list the latest posts. And it is still these functions – positively affecting UX – that should be our guide when choosing what and where to add to our site.

The future of widgets

It seems that widgets will eventually be absorbed into the block system (this is already visible in the current theme architecture). However, they will certainly coexist in the WordPress with Gutenberg blocks for a long time. Most themes still use widgets, including some classic widgets (which require the use of a plugin). Their simplicity and functionality speak in favor of this solution. It can be seen that the choice between widgets and blocks depends on the individual preferences of the user, the type of project and the level of technical advancement. Time will also tell how long widgets will be used in practice.

Anna Starek-Wróbel
Latest posts by Anna Starek-Wróbel (see all)