Drafts showing in deployed hugo site

I set some of the content to draft: true recently after they were active, and it shows 404 not found when i try to hit the link on localhost. However, when I serve the built public file, the draft pages still show up on the deployed site. Is there some flag I need to add in order for the draft: true to kick in and the pages to no longer show?

If you don’t clean out deployed files, then they’re still there. So do one of the following:

(1) remove public dir then build

rm -rf public
hugo

(2) or build with flag

hugo --cleanDestinationDir
1 Like

Adding to what @zwbetz said, if they are already deployed, you’ll need to remove them from your server, where the files are deployed. Some deployment scripts sync up and delete files, but none of mine ever do, so that’s the first place I always check. :slight_smile:

Thank you both of y’all! It did the trick!