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.

1 Answer 1


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.

  • That is a fair answer.
    – Markus
    Commented Sep 19, 2013 at 12:52
  • 1
    I am using the XsltListViewWebPart approach because i can deploy the XSL to the hive, use it in my list definitions, & deploy via a WSP. I believe using a ContentQueryWebPart will shift the XSL out of the WSP into the content level, which will make it harder for me to track & maintain.
    – Markus
    Commented Sep 19, 2013 at 13:02
  • All XSL files for the Content Query Web Part are stored centrally as well and can be provisioned using a WSP. By setting the desired permissions you can control who can modify them. Commented Sep 30, 2013 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.