Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've noticed that nodes that have comments do not have the Change Frequency updated when they have comments attached. One node is listed as yearly, even though I just saved it. Change frequency should be reset to always after saving node, even if there are comments.
Comments
Comment #1
Dave ReidOh hah, yah I think I accidentally removed this as a part of getting the individual priorities and inclusion working. Setting as an alpha blocker.
Comment #2
Coupon Code Swap CreditAttribution: Coupon Code Swap commentedSorry to be the party pooper... errr alpha blocker ;)
Comment #3
Dave ReidNo problem. I had forgotten that I had commented this out in order to get the higher priority stuff working first. Now I can come back to this and get it working right with tests. :)
Comment #4
m3avrck CreditAttribution: m3avrck commentedHey folks, using this on www.mothersclick.com and it's working great with all of our data.
Our SEO firm, iProspect sent in this recommendation...
Once the bug with comments changing the node frequency are addressed, that will address the last point.
The first one though is intriguing -- what about sites that want to force a frequency change for certain types of posts (whether by node type or category type). Seems like a simple setting addition but could add a lot of flexibility depending on the SEO campaign for a site.
Otherwise the new 6.x-2.x-dev is working great!
Comment #5
m3avrck CreditAttribution: m3avrck commentedRelated, the "frequency" option should also be stored with xmlsitemap_custom too. Be great to not only save the priority, but the frequency with each link that is added through this interface.
Comment #6
Dave Reid@m3avrck: Custom links now have a configurable changefreq value.
Working on this as it's the last major alpha blocker. I want to release damnit! :)
Comment #7
Dave ReidPlease try the latest code. It seems to be working just fine. Not sure why I didn't really test it until now. :/
I tested with adding node revisions and adding comments.
Comment #9
webavant CreditAttribution: webavant commentedI tested it just now. The sitemap shows the date of the node save rather than the date of the most recent comment. I have also noticed that my admin/build/modules page does not display any of the comment settings mentioned in the documentation about adding nodes to your sitemap. I updated to the most recent commit just now and tested again with no fix. I noticed that the "XML sitemap node" modules has a weight of 0 while "XML Sitemap" has a weight of 1. Is that my problem? I tried making them 2, but that didn't update it, so I changed it back. I also tried "Enable developer mode to expose additional settings." but didn't notice any changes.
Comment #10
webavant CreditAttribution: webavant commentedAlso, when I go to admin/settings/xmlsitemap/edit/1 it says "There are currently no XML sitemap contexts available." Is that a problem? It also says that when I try to add a new sitemap.
Comment #11
Dave Reid1. Did you regenerate your sitemap after saving the new comment? Is the comment published? Did you also check the data in {xmlsitemap} to see if the 'lastmod' value changed?
2. Documentation is for the 1.x version and needs to be updated.
3. Don't change the weights. They're set up exactly as they should be.
@#10:
That's not a problem. It just simply means there aren't any contexts (like language, domains, etc) available. You can still press 'Save'. You shouldn't be able to have two sitemaps if you don't have any contexts available since they'd be exactly the same.
Comment #12
webavant CreditAttribution: webavant commentedI did everything that you mentioned except check {sitemap}. I was using an outdated version of 2.x-dev from about march, so I updated just now and suddenly it does appear to be updating, only now it's setting the date to today's date for any nodes that have comments. Is that by design?
Comment #13
webavant CreditAttribution: webavant commentedHmmm false alarm. It hasn't updated at all, I was looking at the wrong post. I will check {sitemap}.
Comment #14
webavant CreditAttribution: webavant commentedOK, I checked the xmlsitemap table and found that the lastmod node(s) in question has not been updated. I must be doing something wrong, because this is working for everyone else, right?
Comment #15
webavant CreditAttribution: webavant commentedI guess I should update the status, since I have provided the info you requested. The problem still persists. Any more ideas how I can troubleshoot the issue?
Comment #16
Dave ReidAre the comments published?
Comment #17
webavant CreditAttribution: webavant commentedYes, definitely. There are hundreds of comment on several nodes that are published, yet aren't updating their respective nodes lastmod in the xmlsitemap table.
Comment #18
Dave ReidWhat does the following query return for you (making sure to replace [node-id] with the problematic node ID)?
SELECT c.timestamp FROM comments c WHERE c.nid = [node-id] AND c.status = 0 UNION ALL SELECT nr.timestamp FROM node_revisions nr WHERE nr.nid = [node-id]
Also try the query excluding the UNION ALL SELECT and beyond.
Comment #19
webavant CreditAttribution: webavant commentedIt returns the most recent comment's timestamp and the node's timestamp:
1273645370
1272912314
Without the union it returns just the most recent comment's timestamp:
1273645370
Comment #20
webavant CreditAttribution: webavant commentedAny more ideas? I'm at my wit's end.
Comment #21
webavant CreditAttribution: webavant commentedI'm surprised this issue isn't bothering anyone else. Is no one else noticing this same behavior?
Comment #22
webavant CreditAttribution: webavant commentedJust for my own information, is this the intended behavior by design?
Comment #23
webavant CreditAttribution: webavant commentedGosh, I hate to keep beating a dead horse, but I'm facing using another solution to update my sitemap. Is there anyone that can confirm whether or not this is a bug or a feature?
Comment #24
NancyDruNot sure about the alpha-blocker part but I just added a comment to a node and the frequency is still showing "yearly." And this is on 6.x-2.0-beta1.
Comment #25
webavant CreditAttribution: webavant commentedI didn't feel comfortable deleting the "alpha blocker" tag. I'm on 6.x-2.x-dev and I am experiencing the same issue. Thanks for confirming!
Comment #26
NancyDruChanging to "release blocker"
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedDave seems silent again. I'll have to check out the source code and give it a view.
Comment #28
webavant CreditAttribution: webavant commentedI imagine it's something in this line, but I haven't really tested it. It's not really my area of expertise.
(line 197)
Comment #29
Dave ReidI'm still around, just have been very busy. I've tried to help figure out why this wouldn't be working but I haven't been able to come up with an answer, sorry.
Comment #30
locomo CreditAttribution: locomo commentedsubscribe
Comment #31
Dave Reid@webavant: You you manually run that query with a node ID that you're having problems with? What are all the timestamps it returns?
Comment #32
Dave ReidComment #33
Dave ReidI'll reiterate that changefreq is *just a suggestion* to search engines. It's not taken literally and will *not hurt* your site if they are incorrect.
Comment #34
Anonymous (not verified) CreditAttribution: Anonymous commentedDave, I have no trouble believing that it has no merit to a search engine. The merit comes with the end users and potentially some aggregate collectors of the data that give credence to the values.
Comment #35
Coupon Code Swap CreditAttribution: Coupon Code Swap commentedDo you think search engines give no consideration to change frequency when considering how often to crawl a specific page? I could see this being the case if the change frequency is ignored and modified headers etc are used. Just seems strange that change frequency would be included in the sitemap spec if it is meaningless and not used by search engines.
Comment #36
webavant CreditAttribution: webavant commentedCorrect. Rather than run the query again, I'll go ahead and link to the previous post where I reported the query results. I tried the query on several nodes and the timestamps were invariable always the original post date, and not the most recent comment date, or any comment date for that matter. The sitemap consistently showed the original post date for lastmod. You're not having the same problem? I haven't updated the module in a couple of months, but I'm still using 2.x-dev.
EDIT: Oh gosh, I think I may have been looking at things wrong with that query. I'm going to run the query again and report back.
Comment #37
webavant CreditAttribution: webavant commentedOkay, I just updated to current and ran the query on a node with several comments, which returned:
1281808141
1281858626
1281877525
1281878213
1281568814
Should it be returning only the first value, the timestamp of the most recent comment? My sitemap is still displaying the node's original post date, and not the comment's timestamp as the lastmod.
EDIT: I'll reiterate that I'm concerned about the "lastmod" than the "changefreq", although updating both would be nice. Do I need to create a new issue?
Comment #38
NancyDru@undoIT: Whether they do or not, this module can submit as soon as it sees a change, so the frequency is somewhat immaterial because the search engines see the update date and come back to index the updated pages.
Comment #39
Dave ReidAHHH I can finally see what's going on here. It looks like changefreq is getting calculated correctly if it's returning those resutls. However, the 'lastmod' value is always using the $node->changed, which is not updated when a comment is added. We should instead be using the MAX() value from that list.
Comment #40
webavant CreditAttribution: webavant commentedThat sounds right. I guess I should have posted a new issue originally. I'll step out of the discussion and allow the 'changefreq' argument to continue, as don't have much of an opinion about it.
Comment #41
Coupon Code Swap CreditAttribution: Coupon Code Swap commentedHi Dave. Have you come up with a method for updating or manually setting changefreq / lastmod for taxonomy terms?
Comment #42
Dave Reid@undoIT: I've filed a feature request for the taxonomy sub-module here #893282: Support lastmod and changefreq values for taxonomy terms to keep it separate from this discussion.
Comment #43
Dave ReidI have committed a fix to CVS to address the lastmod value not updating when comments are added to nodes.
http://drupal.org/cvs?commit=412014
http://drupal.org/cvs?commit=412016
I want to double check back on the original issue: "One node is listed as yearly, even though I just saved it. Change frequency should be reset to always after saving node, even if there are comments." This statement is not true. The changefreq is an average of all your node revision timestamps and published comment timestamps. If you saved a node over three years ago and it's had two new comments, the average time between those changes is still yearly. Note that the proper 'lastmod' value will be shown now though, which is a helpful indicator to search engines when the page actually changed and if it needs to be reindexed or not.
So it's my belief that this is now addressed, everything else has separate issues filed, so I'm marking as fixed.
Comment #44
webavant CreditAttribution: webavant commentedCool! This fixes the issue in my mind. The lastmod is now displaying as expected and the changefreq seems to update accordingly, displaying a more frequent interval for nodes with recent comments. Thanks!