Edgewall Software
Modify

Opened 2 weeks ago

Last modified 2 weeks ago

#13780 new enhancement

Block robots from ticket (comment) edit history

Reported by: anonymous Owned by:
Priority: low Milestone: next-stable-1.6.x
Component: ticket system Version: 1.6
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by anonymous)

To reduce server load caused by crawlers.
To disarm spam links in ticket comment history (that is, if spam comments have not been properly deleted).

Add a rel="nofollow" attribute to the link to the ticket description edit history. (The page it points to has <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> already.)

Add a rel="nofollow" attributes to the links to ticket comment edit history.

Add <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> to ticket comment edit history pages.

AFAIK, there are crawlers that won't access nofollow-links if there are no other references. The semantics however just says to not add weight to such links in ranking, which is also desired here.

Attachments (0)

Change History (3)

comment:1 by anonymous, 2 weeks ago

Description: modified (diff)

comment:2 by Jun Omae, 2 weeks ago

Component: web frontendticket system
Milestone: next-stable-1.6.x

It seems that it makes sense.

The <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> line is declared at source:/tags/trac-1.6/trac/templates/diff_view.html@:27. The template is used in trac/ticket/web_ui.py:

$ git grep -n 'diff_view\.html' trac-1.6 -- '*.py'
trac-1.6:trac/ticket/web_ui.py:1047:        return 'diff_view.html', data
trac-1.6:trac/ticket/web_ui.py:1181:        return 'diff_view.html', data
  • trac/ticket/templates/ticket_box.html

    diff --git a/trac/ticket/templates/ticket_box.html b/trac/ticket/templates/ticket_box.html
    index 8a8ff2354..302f62310 100644
    a b  
    163163        # if description_change:
    164164        <a href="${href.ticket(ticket.id, action='diff',
    165165                 version=description_change.cnum)}"
     166           rel="nofollow"
    166167           class="lastmod trac-diff"
    167168           title="${description_change.date}">
    168169          # trans author = authorinfo(description_change.author)
  • trac/ticket/templates/ticket_change.html

    diff --git a/trac/ticket/templates/ticket_change.html b/trac/ticket/templates/ticket_change.html
    index ba8a68f70..d91b8e0c9 100644
    a b ${jmacros.warnings(chrome.warnings, 'trac-preview-warning')}  
    242242  #   endif
    243243  #   if comment_version is greaterthan(0):
    244244  (<a href="${href.ticket(ticket.id, action='comment-diff', cnum=cnum,
    245                           version=comment_version)}">${
    246     _("diff")}</a>)
     245                          version=comment_version)}"
     246      rel="nofollow">${_("diff")}</a>)
    247247  #   endif
    248248</div>
    249249#   endif

However, crawlers can follow the diff links in <link rel="prev" /> and <link rel="next" />.

Last edited 2 weeks ago by Jun Omae (previous) (diff)

comment:3 by Jun Omae, 2 weeks ago

Workaround is to add the following lines to your robots.txt:

Disallow: /ticket/*?action=*
Disallow: /ticket/*?cnum_hist=*
Disallow: /ticket/*?cversion=*
Disallow: /ticket/*?replyto=*
Disallow: /ticket/*?version=*

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.