If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
October 19, 2012 at 1:34 pm #17176
how can I exclude certain pages, categories and/or tags from the archive/sitemap?
Can I do this in – what – theme file and which with code?
Or can you recommend a good plugin for this?
The “Simply Exclude” plugin, that I have, can only exclude a page from “search” and from “Pages – Widget”.
Thanks a lot.October 20, 2012 at 6:03 am #94451
Try to use this plugin: http://wordpress.org/extend/plugins/page-list/
Just check their documentation on how to exclude pages. :)
IsmaelOctober 20, 2012 at 2:40 pm #94452
Thanks, but as far as I have understood here, I can create with it my own sitemap for example.
But I won’t get lost of the good template from CORONA, showing the archive/sitemap like in the demo here and won’t “hardcode” the theme files for every page I would like to exclude.
Any other suggestions of someone?
Thanks.October 22, 2012 at 1:54 am #94453
The Sitemap on the demo site only uses ‘Archives’ as its template and doesn’t have the ability to filter pages to be excluded from the sitemap. Let me tag the rest of the support, as the only thing I recommend to you now is using that plugin.
IsmaelOctober 22, 2012 at 12:15 pm #94454
I took a look and can’t seem to find a plugin with that functionality.
Why don’t you just make the pages you don’t want on the sitemap Private? This way people who know the URL can still get to the pages but they will no longer be listed on the sitemap nor in navigation (since you don’t want them in sitemap then I guess you wouldn’t want them in navigation either).
NickOctober 22, 2012 at 3:05 pm #94455
thanks, but this is no alternative, to set them to private, because these pages have their own sense, but need not to be accessible by a sitemap, for example my comment-subscription page, where the user can manage his subscriptions; this as “stand-alone-page” shown in the sitemap is not good. As well as I don’t want to show the Impressum page explicitely in the sitemap or any advertising page.
If there is no plugin, is there a possibility in the archive/sitemap, to “hardcode”, to exclude special page IDs from the sitemap/archive?
The old “Advanced Category excluder” was perfect for pages, too, but it is too old and doesn’t work with CORONA.October 22, 2012 at 3:40 pm #94456
Well, you can view source on the sitemap that you don’t like, copy it to notepad, remove the links you don’t want and paste it into a regular page.
Another option that’s even easier, would be to add a custom meta field called ‘exclude’ with value of 1 to pages and posts you want to exclude and on the page that generates the sitemap to prevent any post/page from being displayed that has exclude=1 metafield value. You only want to block pages and posts right? or categories, tags, custom taxonomies and post types too?
NickOctober 22, 2012 at 4:09 pm #94457
this is quite inconvenient, sorry, isn’t there a possibility to exclude within the archive/sitemap template PHP file the IDs of my certain pages, that should not appear in archive/sitemap? I don’t know the right syntax, but I’m sure, that there was something like that …
I just want some, about 5, 6 pages to be excluded only from sitemap/archive, no posts, no categories, just pages.October 22, 2012 at 6:48 pm #94458
Please make a backup copy, and open up template-archives.php located at the root of the theme, and find line 150,
which looks like
and change it to look like
**Please replace 1,2,3,4,5 with the page ID’s that you want to *exclude* from your sitemap, there is no limit but they must all be pages.
NickOctober 23, 2012 at 6:57 pm #94459October 23, 2012 at 7:05 pm #94460
The topic ‘How to exclude pages/categories/tags from archive/sitemap?’ is closed to new replies.