Question

I have an XsltListViewWebPart on a publishing page. I am using custom XSL to style the view; I am not even using the ECB menu.

Why is Google indexing the ECB menu's HTML & JavaScript? When i search for my site with Google, I see the following:

Google http://imageshack.us/a/img33/4882/6t4g.png

In the WebPart's generated HTML, in the ECB menu's code block, I see the following <div>.

<div>javascript:commonShowModalDialog(&#39;{SiteUrl}/_layouts/itemexpiration.aspx?ID={ItemId}&amp;List={ListId}&#39;, &#39;center:1;dialogHeight:500px;dialogWidth:500px;resizable:yes;status:no;location:no;menubar:no;help:no&#39;, function GotoPageAfterClose(pageid){if(pageid == &#39;hold&#39;) {STSNavigate(unescape(decodeURI(&#39;{SiteUrl}&#39;))+&#39;/_layouts/hold.aspx?ID={ItemId}&amp;List={ListId}&#39;);  return false;} if(pageid == &#39;audit&#39;) {STSNavigate(unescape(decodeURI(&#39;{SiteUrl}&#39;))+&#39;/_layouts/Reporting.aspx?Category=Auditing&amp;backtype=item&amp;ID={ItemId}&amp;List={ListId}&#39;); return false;} if(pageid == &#39;config&#39;) {STSNavigate(unescape(decodeURI(&#39;{SiteUrl}&#39;))+&#39;/_layouts/expirationconfig.aspx?ID={ItemId}&amp;List={ListId}&#39;); return false;}}, null); return false;</div>

Now I am no SEO expert, but there is plenty of other relevant, semantic content both before & after this <div> that Google should be displaying rather than this nasty codeblock. (Why is this a <div> & not a <script> anyway?)

Is there a way to remove the ECB menu entirely? I am not using it at all (at least not on any publishing pages). If not, how can i ensure that it doesn't get indexed by search engines?

Edit (10/1/2013): Lets approach this from a different angle. What horrible SEO mistakes could i have made that would have caused the ECB menu to get indexed over the other content? Most of the content preceeding the ECB menu is nothing but <h1>, <p>, & <a> tags wrapped in some <div> tags. There is some JavaScript animations, but everything is initially visible.

Was it helpful?

Solution

If you're not using the capabilities of the XsltListViewWebPart I'd suggest you use the Content Query Web Part instead which gives you more control about the rendered HTML.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top