Do you want to create compact archives on your WordPress website?
If you have been blogging for a few years, then the list of your posts might have become too long to fit in your WordPress sidebar. This will make your sidebar look cluttered, which won’t be good for your site presentation.
In this article, we will show you how to easily create compact archives in WordPress.
Why Do You Need Compact Archives in WordPress?
Adding an archive on your WordPress website allows you to easily display your previously published content, increasing engagement and time spent on your website.
By default, WordPress offers an Archives block that can be added to the sidebar of your WordPress blog.
However, this block only allows you to display your archives as a long list or a dropdown menu.
A list will make your site look cluttered, while a dropdown menu can be easily overlooked by users as it is not as noticeable.
By creating compact archives, you can easily display your archives in the WordPress sidebar without taking up much space. You can also show them on your About page or even create a dedicated Archives section.
Compact archives will make it easier for users to navigate through your site and find relevant content, enhancing the user experience.
Archives can also boost your search engine rankings and attract more organic traffic by making it easier for search engine bots to crawl and index your content.
That being said, let’s take a look at how to easily add compact archives in WordPress, step by step.
How to Add Compact Archives in WordPress
Now, the plugin offers three styles to display compact archives on your website.
Style 1: Relaxed Three-Letter Month Initials
Style 2: Compact Monthly Initials
Style 3. Numeric Block
There are multiple ways to easily display compact archives on your website.
In this tutorial, we will be showing you all four methods, and you can choose the one that you like the most.
Method 1: Add Compact Archives in WordPress Posts or Pages
If you want to add compact archives to your WordPress posts or pages, then this method is for you.
It is super easy to add compact archives because the plugin comes with an easy-to-use block that you can add to your post or page.
First, you need to open an existing or new post/page from the WordPress admin sidebar.
Once you are there, click the ‘+’ button in the top left corner of the screen to open up the block menu.
From here, find and add the WPBeginner’s Compact Archives block to your WordPress post or page.
After that, you can choose a style for your archives from the block panel in the right corner of the screen.
Simply choose a style of your liking from the dropdown menu under the ‘Select Archive Type’ option.
You can also choose if you want your archive text to be capitalized or uppercase.
To do this, you have to open the dropdown menu under the ‘Transform Text’ option and choose a text style of your liking.
Once you are satisfied with your choices, simply click the ‘Publish’ or ‘Update’ button to store your settings.
Now, you can visit your WordPress site to view your archives page.
Method 2: Add Compact Archives as a Widget
If you want to add compact archives as a widget, then this method is for you.
Adding the Compact Archives Block in Full Site Editor
If you are using a block-based theme on your website, then you will have to add the WPBeginners’ Compact Archives block using the full site editor.
First, you need to visit the Appearance » Editor page from the WordPress admin sidebar to launch the FSE.
From here, click the ‘+’ button in the top-left corner of the screen to open up the block menu.
Next, simply locate and add the WPBeginner’s Compact Archives block to your preferred place on the website.
Once you have added the block, you can configure its style and text settings from the block panel on the right.
Finally, don’t forget to click on the ‘Save’ button at the top to store your settings.
Now visit your website to view your compact archives.
This is what it looked like on our demo site.
Adding the Compact Archives Block Using Widgets
If you are not using a block-based theme, then this method is for you.
First, you need to visit the Appearance » Widgets page from the WordPress dashboard.
Once you are there, click the ‘+’ button in the top left corner to open up the block menu.
From here, locate and add the WPBeginner’s Compact Archives block to the sidebar tab.
Once the Compact Archives block has been added, you can change the style and text of your archive by configuring the block settings in the panel on the right.
Finally, don’t forget to click the ‘Update’ button at the top to save your changes.
You can then visit your website to see the compact archives in your sidebar.
It looked like this on our demo site.
Method 3: Displaying Compact Archives in Template Files
Simply add the following template tag to your code:
<ul> <?php compact_archive(); ?> </ul>
After adding the tag, compact archives will be added to your WordPress page.
However, if you want to add a style to your archive, you can do so by adding the following template tag in your code:
<ul> <?php compact_archive($style='initial', $before='<li>', $after='</li>'); ?> </ul>
$style == 'initial' will display only month name initials and should fit right inside a sidebar. Using
$style == 'block' will fit the main column of a page. Using
$style == 'numeric' will display numeric months.
Method 4: Add Compact Archives to Your HTML Sitemap
If you want to create an HTML sitemap page in WordPress and display your compact archives with it, then this method is for you.
It even lets you easily add an HTML sitemap to your WordPress site.
Note: AIOSEO also has a free version that you can use to create an HTML sitemap. However, we will be using the premium version for more features.
Upon activation, the plugin will launch the setup wizard. Simply follow the on-screen instructions to set up the plugin or see our guide on how to properly set up All in One SEO for WordPress.
Once you have done that, head over to the All in One SEO » Sitemaps page from the WordPress admin sidebar.
From here, switch to the ‘HTML Sitemap’ tab from the top and make sure that the ‘Enable Sitemap’ toggle is turned on.
Next, you need to choose how you want to display your HTML sitemap. You can display your sitemap using a shortcode, PHP code, a block, or as a widget.
For this tutorial, we will be choosing the ‘Gutenberg Block’ option.
If you choose this method, then you will have to add the AIOSEO – HTML Sitemap block to the page where you wish to display the sitemap.
For more detailed instructions, you may want to see our tutorial on how to add an HTML sitemap page in WordPress.
Next, you need to scroll down to the ‘Compact Archives’ option in the ‘HTML Sitemap Settings’ section.
From here, simply toggle the ‘Compact Archives’ switch to ‘Enabled’.
Keep in mind that you don’t need to install the Compact Archives plugin for this feature to work.
Now, your HTML sitemap will be displayed in a compact date archive format.
Finally, don’t forget to click on the ‘Save Changes’ button to store your settings.
Next, open up an existing or new page where you want to display the sitemap from the admin sidebar.
From here, simply click on the ‘+’ button in the top left corner of the screen and then add the AIOSEO-HTML Sitemap block to your page.
Finally, don’t forget to click the ‘Publish’ or ‘Update’ button to save your changes.
Your compact archives HTML Sitemap will look like this.
We hope this article helped you learn how to easily create compact archives in WordPress. You may also want to see our beginner’s guide on how to create an email newsletter in WordPress and our top picks for the best social media plugins to help promote your website.