Hide a title for a specific news in SharePoint Online modern news web part

Currently SharePoint online news web part will display the title of the page for all the news, like this:

In some cases, you may want to hide this title because the picture either interferes with the text or the picture is more of a banner and doesn’t need a title.

In either case, there is a solution to this.

First, you need to enable an ORIGAMI script editor web part on your modern SharePoint site.

Now follow these steps:

  1. Edit the page where your news web part is and add a script editor web part above or below it
    image

  2. Add the following markup to the web part

<style>
a[data-automation-id$="newsItemTitle"][href$="ongoing%5D.aspx"] { display: none; }
</style>
  1. Save the web part and the page.

  2. Navigate to the Site Pages library on your site

  3. For each of the pages for which you don’t want to show the title, append this word at the end of the filename: [ongoing]
    For example: image

This will identify pages for which you don’t want to show the title for.

The results: the picture will still link to the news story but no title will be displayed.