Make WordPress Core

Opened 17 years ago

Closed 11 years ago

#11360 closed enhancement (fixed)

Don't nofollow links within the site

Reported by: caesarsgrunt Owned by: swissspidy
Priority: normal Milestone: 4.5
Component: Comments Version: 2.9
Severity: normal Keywords: has-patch has-unit-tests commit
Cc: Focuses:

Description

Relative links or links with the site's own domain shouldn't be nofollowed.

This use of nofollow is damaging to the site's search engine rankings.

Attachments (3)

11360.diff (576 bytes ) - added by caesarsgrunt 17 years ago.
11360.2.diff (2.9 KB ) - added by swissspidy 11 years ago.
11360.3.diff (3.2 KB ) - added by swissspidy 11 years ago.

Download all attachments as: .zip

Change History (19)

#1 @caesarsgrunt
17 years ago

See also #11359 (Don't nofollow links in admin comments)

@caesarsgrunt
17 years ago

#2 @caesarsgrunt
17 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Attached patch (didn't mean to upload it twice...) doesn't add nofollow to links within the site (eg {exapmle.com or /). It does add nofollow to links to other sites (eg google.com), including tricky sites whose domain starts with the siteurl (eg example.com.badsite.com).

#3 @dd32
17 years ago

didn't mean to upload it twice...

I just deleted 11360.2.diff to keep things straight forward :)

#4 @caesarsgrunt
17 years ago

Thanks dd32.

I'd quite like some feedback on this patch - is there anything wrong with this approach? If not, it'd be really nice to get it into 2.9... :-)

#5 @caesarsgrunt
17 years ago

  • Milestone Unassigned3.0

#6 follow-up: @hakre
17 years ago

Some feedback: How to reflect mixed usage of HTTP and HTTPS in that patch? Any Idea?

#7 @hakre
17 years ago

  • Keywords has-patch, needs-testing → has-patch needs-testing

#8 in reply to: ↑ 6 ; follow-up: @caesarsgrunt
17 years ago

Replying to hakre:

Some feedback: How to reflect mixed usage of HTTP and HTTPS in that patch? Any Idea?

Not sure what you mean... does http/https make any difference in the patch?

#9 in reply to: ↑ 8 @nacin
17 years ago

Replying to caesarsgrunt:

Replying to hakre:

Some feedback: How to reflect mixed usage of HTTP and HTTPS in that patch? Any Idea?

Not sure what you mean... does http/https make any difference in the patch?

The get_option() call there will only return the http:// link, not https://. There's a new function home_url() that could be used, but that still wouldn't prevent an http:// link from not being picked up on a forced SSL site and vice versa.

At the very least, using home_url() makes sense to make sure the right protocol is searched for. Checking both protocols wouldn't be a bad idea though.

#10 @nacin
16 years ago

  • Milestone 3.0Future Release
  • Type defect (bug)enhancement

#11 follow-up: @chriscct7
12 years ago

  • Resolutionduplicate
  • Status newclosed

This was resolved, in later commits, including #10550

#12 in reply to: ↑ 11 @ocean90
12 years ago

  • Resolution duplicate
  • Status closedreopened

Replying to chriscct7:

This was resolved, in later commits, including #10550

No, it isn't. #10550 is about reply to links.

#13 @swissspidy
11 years ago

  • Keywords needs-patch added; has-patch needs-testing removed

Needs a new patch using home_url(), perhaps even checking for https and http (using set_url_scheme() maybe?)

@swissspidy
11 years ago

#14 @swissspidy
11 years ago

  • Keywords has-patch has-unit-tests added; needs-patch removed
  • Milestone Future Release4.5

11360.2.diff is a refreshed patch that ensures home_url() gets ignored, no matter if https or http is used.

Also includes unit tests for wp_rel_nofollow()

#15 @swissspidy
11 years ago

  • Keywords commit added

@swissspidy
11 years ago

#16 @swissspidy
11 years ago

  • Owner set to swissspidy
  • Resolutionfixed
  • Status reopenedclosed

In 36125:

Comments: Don't nofollow links within the site.

Fixes #11360.

Note: See TracTickets for help on using tickets.