This module provides a Drupal admin side interface to remove more than one URL from sitemap at once using friendly configurations. Reduces manual way of visiting each node to exclude it from XML sitemap.

Similar feature available in other project and how they are different

XML sitemap

The XML sitemap module doesn't have an option to exclude different type of URLs (node, taxonomy) at once. To exclude different URLs, need to navigate each node, taxonomy to exclude it from sitemap.

Project link

https://www.drupal.org/sandbox/logeshwaran/2990127

Git instructions

git clone --branch 7.x https://git.drupal.org/sandbox/Logeshwaran-2990127 xml_sitemap_bulk_link_exclude

PAReview issue report

https://pareview.sh/pareview/https-git.drupal.org-sandbox-logeshwaran-29...

Manual reviews of other projects

Comments

Logesh waran created an issue. See original summary.

logesh waran’s picture

logesh waran’s picture

Status: Active » Needs review
logesh waran’s picture

Issue summary: View changes
logesh waran’s picture

Title: XML Sitemap Bulk Link Exclude » XML Sitemap Bulk Link Exclude (D7)
arulan_pari’s picture

Hello @Logesh Waran,

I have checked your module in PAReview and there is no error. Great!!!

Your module is a much needed one. You have classified the XML site exclude by both ways

  1. Exclude links by textarea
  2. Exclude links by table

That's Awesome and developer friendly too. I like the "Exclude links by textarea" way.

I have found one error, In XML sitemap Bulk Link Exclude Table page is showing your config path (admin/config/search/list/xml_exclude_links) under the URL column by default. For your quick identification I have attached the screenshot.

Could you fix the issue?

arulan_pari’s picture

Status: Needs review » Needs work
logesh waran’s picture

Hi Arulan,

Thanks for your response. I will address the issue.

logesh waran’s picture

Hi Arulan,

The above mentioned issue is addressed. Thanks

avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Title: XML Sitemap Bulk Link Exclude (D7) » [D7] XML Sitemap Bulk Link Exclude
Assigned: logesh waran » Unassigned
Status: Needs work » Needs review
logesh waran’s picture

logesh waran’s picture

Issue summary: View changes
logesh waran’s picture

sagar_cis’s picture

StatusFileSize
new11.38 KB

Hello @Logesh waran

First of all great module, i have found a very small issue, i just install module and check "Xml Sitemap Bulk link exclude table" which is empty of course, so i got message which says "No users found", I think it should be "No links found".

sagar_cis’s picture

Status: Needs review » Needs work
avpaderno’s picture

Issue tags: -PAreview: security
avpaderno’s picture

Issue summary: View changes
avpaderno’s picture

Issue summary: View changes
sagar_cis’s picture

Hello @Logesh waran

you have used following code to update xml sitemap link.

$check_val = isset($form_state['values']['table']) ? $form_state['values']['table'] : '';
  if ($check_val !== '') {
    foreach ($check_val as $key => $value) {
      if (!is_null($check_val[$key]) || $check_val[$key] !== '') {
        $fields = array('status' => 0, 'status_override' => 1);
        db_update('xmlsitemap')->fields($fields)->condition('loc', $value, '=')->execute();
      }
    }
    drupal_set_message(t('Selected xml links has been successfully removed from xml sitemap!. Please regenerate
    the sitemap to see the changes.'));
  }
$exclude_values = isset($form_state['values']['xml_sitemap_bulk_link_exclude_array']) ? $form_state['values']['xml_sitemap_bulk_link_exclude_array'] : '';

  if (!empty($exclude_values)) {
    foreach ($exclude_values as $key => $value) {
      if (isset($exclude_values[$key])) {
        $fields = array('status' => 0, 'status_override' => 1);
        db_update('xmlsitemap')->fields($fields)->condition('loc', $value, '=')->execute();
      }
    }
  }
  else {
    drupal_set_message(t("There are no links entered to exclude."));
  }

Where you are directly updating the values in tables, which will compliantly ignore "hook_xmlsitemap_link_update". you should use drupal_alter in your code, so other modules can still do there stuff with this module.

logesh waran’s picture

Hi sagar_cis,

Thanks for your response. i will have a look and update here. thanks :)

logesh waran’s picture

Comment #15 issue resolved

arulan_pari’s picture

Hi @Logesh,

Your latest code is removed the config path(admin/config/search/list/xml_exclude_links) and changed typo error of "No users found" refer(#15).

Hi @sagar_cis,

#20 - Actually, The site admin can directly remove the sitemap URLs using the configuration. It is not necessary to add drupal_alter(HOOK).

And those pages are built by the Drupal form, so you can easily able to override the form_state values (XML-site URLs) using form_alter.

logesh waran’s picture

Status: Needs work » Needs review
avpaderno’s picture

Actually, #20 is correct: When there is a hook that is invoked when data is changed, it should be invoked. It's exactly what Drupal does when an entity is changed: It doesn't simply alter the values in the database tables, but also invoke those hooks that tell the modules an entity has been changed.

logesh waran’s picture

@Kiamlaluno, thanks for the information. i will update

logesh waran’s picture

Hi Team,

Now, I have replaced the database update with "XML sitemap" module's "xmlsitemap_link_update_multiple" function which will do the same
work and which informs the XML sitemap module that an entity is modified. So xml sitemap module triggers a regenerate flag which informs that updates has been occurred in entity and need to regenerate the sitemap.

jabastin arul’s picture

Logesh,

I have checked your module and everything seems to be working fine. So I will change your module status to RTBC.

All the best.

Thanks,
Jaba

jabastin arul’s picture

Status: Needs review » Reviewed & tested by the community
avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

avpaderno’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.