SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a content query web part that displays all the latest documents added to a site collection but there are one or two occasions where a file will be uploaded that the user doesn't want advertised as uploaded.

People should still have their normal access to the file but it shouldn't be returned as a result in the Content Query Web Part on the main page.

Is there a way to flag specific files on upload/creation so that they don't get displayed in a CQWP?

share|improve this question
up vote 2 down vote accepted

Add a new field to the document library, a Yes/No field.. asking user to select whether he wants the document to advertise or not.. Add a filter in Content Query Web Part for this field..


For multiple document libraries

Approach 1:
Write a Powershell script to add this field to each document library.. Or using SharePoint Object Model add this field to document libraries..

Approach 2:
Make a site column i.e. Yes/No field, create a content type.. Add this field in the content type and make the document libraries to inherit this content type..

Either way you need to iterate all document libraries!

share|improve this answer
Is there a way that works for a number of libraries? This solution is good for one library but the site collection has several sites each with several document libraries. Would this field have to be added to each document library? – Donald Dunlop Sep 30 '13 at 13:21
@DonaldDunlop see update on Answer – Arsalan Adam Khatri Sep 30 '13 at 13:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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