Code To Find List Of Posts Which Has No Tags In WordPress Blog

Posted by

Hi,

In order to find and display the untagged posts in blog, you need to use this code:

<?php query_posts(‘orderby=title&order=asc&showposts=-1’); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$tag = get_the_tags();
if (!$tag) { //Theses posts have no tags
the_title();
}
endwhile;
endif; ?>

Add this code in any template where you want to display untagged posts of the blog.

That’s it!

Thanks,

Shane G.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.