57

See the image. I randomly searched for "what is service layer in MVC" on Google. Google returned a Stack Overflow answer whose first 4-5 words actually "spells" the vote arrow, the actual votes, down vote arrow and accepted control. This also suggests that Google specifically searched for the answer which was accepted. But why are input controls spelled?

I know that is not going to make any deteriorating effect on quality. But it's little weird. Is it bug from Google or from Stack Overflow?

Screenshot

14
  • 16
    The up and downvote arrows are actually links with the words "up vote" and "down vote" within them. CSS is used to hide the text and show the icon. Google's scraper doesn't see the CSS and prints the text. Note that there's two links below the box: "About this result" and "Feedback". Feel free to click on either of those :). Sep 8, 2016 at 14:47
  • 8
    @MikeMcCaughan seems unreasonable to expect google to have to understand and adapt to the implementation of SE. Sep 9, 2016 at 4:05
  • 14
    @Amani Kilumanga In this case, I disagree, it is somewhat reasonable. This is a special case result from Google, and SO is a large and popular enough site that they probably do some special case tweaks for it. See also duckduckgo.com--many searches there also show special case answer snippets that come from SO.
    – mherzig
    Sep 9, 2016 at 4:28
  • 1
    @Amani I don't expect Google to make some search results look different from others. I was just commenting on the fact that the answer to this question likely less within the links at the bottom of that box.... Sep 9, 2016 at 13:18
  • Previously they didn't show the link button text - I may have used the feedback link on the google resuolt for a way to vote up/down.... Sep 9, 2016 at 15:47
  • 3
    It is perhaps worth noting what a silly practice this is when they display the link to the original post twice, close together. I suspect this is some sort of attempt to slow down a Google user, increasing the odds he won't immediately leave the site again and might read sponsored ads. They also violate the site license, not attributing content properly. Not because it is hard to do so, just because they can. As such, I'd say it is most definitely Google's burden to ensure this content is readable. And in the interest of SE to not help. And in our interest, votes matter. Sep 9, 2016 at 16:30
  • 6
    I added the freehand circle you forgot to put in that screenshot. I just couldn't bring myself to upvote your post without it ;-) Sep 9, 2016 at 19:53
  • At least the votes are showing up now. I think this is progress. Give google time, they will get it setup. They do have other more pressing issues to solve than fixing erroneous text in edge cases.
    – Travis J
    Sep 9, 2016 at 20:27
  • 1
    Leaving feedback matters! If this is something that is an issue you are interested in then search for the phrase shown (what is server layer in mvc) and then click "feedback" on the one-box; and then leave some constructive feedback on the vote text being slightly off (or perhaps the authorship points that were raised). If enough of these are all brought up on this one place it will draw attention to the issue where it can actually be solved.
    – Travis J
    Sep 9, 2016 at 20:35
  • 2
    We now have someone adding solved to titles making it "Google friendly"...
    – Jongware
    Sep 9, 2016 at 21:50
  • @LucasTrzesniewski how did you do that? I put together a freehand-circled screenshot myself, but wasn't able to edit the post. Sep 10, 2016 at 6:24
  • @AmaniKilumanga I didn't have any problem editing the post, I just clicked here. Sep 10, 2016 at 10:07
  • @LucasTrzesniewski I don't have that. Must be related to the edit privilege. Sep 10, 2016 at 14:30
  • @AmaniKilumanga hmm, looks like you can't suggest edits on meta, I didn't know that. Sep 10, 2016 at 15:16

3 Answers 3

15

In any case, I would say that this is a bug on Google's end. SO is already using microdata to annotate the relevant content on its Q&A pages, and Google's own testing tool is parsing it just fine.

(Looking at the page source, I do notice that we could be making more use of microdata than we already are. For example, comments are not currently marked up with microdata at all, even though there's a schema for that, and we're also not annotating the author / editor links and timestamps below posts. But that's something for a separate feature-request.)

Furthermore, the issue shown in your screenshot seems to only affect the featured snippet at the top of the search results page — the normal search results below look just fine, even when showing the exact same page. So I'd say that this is an issue with the featured snippet generation at Google — for some reason, it's ignoring the explicit text property used to mark the post text in the SO microdata, and instead choosing to show the entire content of the Question item (which just happens to begin with the vote buttons).


Now, I'm sure that SO could modify their HTML code so that those vote buttons would not show up in Google's snippets. (The easiest way would be to simply remove the hidden text.) The not so easy part is finding a way to do that while still keeping them accessible by screen readers and text-only browsers.

One option would be to restructure the HTML so that the vote buttons logically come after the post text. Given SO's table-based post layout, this would be a bit tricky to do, but not impossible — for example, the HTML could be changed from the current:

<table>
    <tr>
        <td class="votecell"><!-- vote buttons here --></td>           
        <td class="postcell"><!-- post text here --></td>
    </tr>
    <tr><!-- comments etc. here --></tr>
</table>

to something like:

<table>
    <tr>
        <td style="height: 0px"><!-- empty zero-height cell --></td>           
        <td class="postcell" rowspan="2"><!-- post text here --></td>
    </tr>
    <tr>
        <td class="votecell"><!-- vote buttons here --></td>           
    </tr>
    <tr><!-- comments etc. here --></tr>
</table>

That could be a lot of work for a minor change, especially since this would also require some code review and testing to make sure that nothing in the SO front-end JS code breaks because it assumes that post text and vote buttons share the same parent table row. (A quick search I just did found only a single suspicious .closest("tr") call, and that's in the comment UI code, but I could easily have missed something.) Still, Google SERPs are kind of important for SO, so this might be worth spending the effort, even if it's (arguably) just a workaround for a Google bug.


Ps. If you want to test the effect of the HTML change suggested above on SO, you can paste the following jQuery code to your browser's JS console and run it:

$('.postcell, .answercell').each( function () {
    var row = $(this).closest('tr'), vote = row.children('.votecell');
    if (vote.length == 0) return;
    row.prepend('<td style="height: 0px">').after( $('<tr>').append(vote) );
    $(this).attr('rowspan', 2);
} );

At a glance, everything seems to look and work the same after running this code, although I only spent a few minutes testing this.

25

It's Google just reading the text for the links on the arrows. If you "Inspect Element" on the vote arrows for answers, you see:

<a class="vote-up-off" title="This answer is useful">up vote</a>

and

<a class="vote-down-off" title="This answer is not useful">down vote</a>
6

Ilmari Karonen's answer is pretty spot on, and I'm gonna grab one of its sentences: That could be a lot of work for a minor change. The cost/benefit thing striking back as usual. But thanks for contributing to the bug hunt!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .