WordPress.org

Ready to get started?Download WordPress

Forums

Google XML Sitemaps
Exclude pages (10 posts)

  1. fedup1979
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to exclude a few pages from sitemap but that doesn't seem to work...

    Plugin says : exclude page : insert ID. So I'm typing : /pagexyz/
    It says ok, but the page still remains on sitemap...

    Any idea about what I'm doing wrong ??

    Thanks a lot !

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  2. biswajeet
    Member
    Posted 1 year ago #

    Yeh thats what I face too...
    Unlike the previous version, it wouldn't rebuild the site map automatically when exclude item changes. You need to build it manually to get the change effect.

  3. fedup1979
    Member
    Posted 1 year ago #

    Hi Biswajeet and thanks.

    I do rebuild but then pages are still on the sitemap...
    I'm wondering if I'm typing the ID properly. Just to be shure, the ID is something like /ID/ if the page to exclude is http://www.mydomain.com/ID/ right ?

    Again thanks !

  4. biswajeet
    Member
    Posted 1 year ago #

    To get the correct post/page ID when you are using clean url mode -> just hover on Edit link to view the correct id.

    Hope that will solve the problem!

  5. fedup1979
    Member
    Posted 1 year ago #

    Thanks a lot,

    So now I'm sure to be typing ID properly but still nothing changes...

    Have an idea ?

    Thanks,
    Regards.

  6. phoenixpro
    Member
    Posted 1 year ago #

    Having exactly the same problem - won't exclude any pages no matter what I input. I've spent more than an hour searching forums trying to see if there is a fix for this. Any help would be greatly appreciated!

  7. fedup1979
    Member
    Posted 1 year ago #

    Hi,

    Just add meta robots plugin, this way you can tell on each page whether it must be indexed or not by bots. Works fine.

    Hope it helps,
    Regards.

  8. phoenixpro
    Member
    Posted 1 year ago #

    Thanks for the tip! I installed the plugin and rebuilt the sitemap manually - several times - all of the pages are still there. (I'm trying to exclude sign-up confirmation pages etc)

    http://hunterphoenixcoaching.com/site-map/

    I've cleared the cache and used different browsers.

    Any other ideas would be really appreciated! Thanks a bunch.

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  9. microberto
    Member
    Posted 1 year ago #

    Ditto here. This is a great plugin but needs a patch to work for pages to exclude.

  10. amonti
    Member
    Posted 1 year ago #

    I just went through this and successfully excluded a few pages, and I'm using 'post name' for permalinks. The plugin code to exclude posts/page is as follows:

    if(is_array($excludes) && count($excludes)>0) {
           $where.=" AND ID NOT IN ('" . implode("','",$excludes) . "')";
    }

    ID refers to the post/page id from the wp_posts table in the wordpress database. This code basically takes all of the post IDs entered in the 'exclude' field and ensures that they are excluded from the sitemap creation. This means that nothing but a numeric post ID will work. If you have changed your permalink structure to something that hides the post id, you won't have any idea what the id for a post or page is.

    If you know how to query the WordPress database from phpMyAdmin, MySQL Workbench, or the command line, then maybe you can skip the next step.

    Install and activate the SQL Executioner plugin.

    Then select Tools, then "SQL Executioner"

    You should see an input area at the top where you can enter a query. To find a post by post name, type:

    SELECT ID, post_name FROM $posts where post_name = 'post name'

    If you are using PHPMyAdmin, or MySQL Workbench, you can use:

    SELECT * FROM wordpress.wp_posts where post_name = 'post name'

    Where post name is replaced with the name of the post you are looking for. When you locate your post/page, note the corresponding ID.

    Open the Sitemap plugin and enter the post/page IDs as only numbers (no slashes), separated by commas. Hit Apply, manually rebuild your sitemap, and the posts/pages you entered should be excluded.

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic