When I started working on my website, theidioms.com, I wanted visitors to discover different content every time they visited.
The problem was simple: the default WordPress RSS feed always showed the latest posts in date order.
That was not ideal for a content-heavy website with hundreds of evergreen articles.
Older idiom posts were getting buried, even though they were still highly useful.
So I decided to build a custom solution.
The Problem
WordPress RSS feeds are mainly designed for recent content syndication.
By default, they return:
- the latest published posts
- chronological ordering
- very limited control over randomization
For my use case, this created a discovery problem.
Visitors kept seeing only the newest articles, while older evergreen posts remained hidden.
For a website focused on idioms and phrases, this meant many useful pages were rarely seen.
My Solution
Instead of relying on the RSS feed, I used a custom WP_Query to fetch a random published post directly from the database.
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 1,
'orderby' => 'rand'
);
$query = new WP_Query($args);
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
echo '<a href="' . get_permalink() . '">' . get_the_title() . '</a>';
endwhile;
endif;
wp_reset_postdata();
This returns one random published post every time the page loads.
Why This Helped
This small change solved several issues.
Better Content Discovery
Visitors now land on different idiom pages instead of repeatedly seeing the latest articles.
Increased Engagement
Random internal links encourage users to continue exploring.
Better Use of Evergreen Content
Older articles get fresh visibility without needing to republish them.
Performance Challenge
One issue I quickly noticed was that orderby => 'rand' can become slow on larger sites.
As the database grows, random queries may increase server load.
To solve this, I later cached the result and refreshed it every 15 minutes.
That gave me the benefit of random discovery without stressing the database on every page request.
Final Thoughts
Sometimes the default WordPress tools are not enough for specific use cases.
For my site, replacing RSS with a custom random query improved both user experience and page visibility.
If you run a blog, dictionary site, or any content archive with evergreen posts, this is a simple technique worth trying.
Have you built a similar custom solution in WordPress? Let me know in the comments.
Cheers! Idioms
Top comments (0)