Docs    Facebook    Customizations

Remove a particular string or hashtag from the post text

If you’re using a hashtag to filter posts (eg: #showonwebsite) then you may not want that hashtag to show up in your feed. You can use the following snippet to remove a particular string or hashtag.

Just add the following JavaScript to your site. This can be done manually using a custom JavaScript plugin. For further information see our documentation here.

$('#cff .cff-item').each(function(){
  var $self = $(this),
    str = $self.find('.cff-text').html();
  
  if( typeof str !== 'undefined' ) $self.find('.cff-text').html( str.replace("#myhashtag", "") );
});

To remove multiple hashtags, just add more as shown below:

$('#cff .cff-item').each(function(){
  var $self = $(this),
    str = $self.find('.cff-text').html();
  
  if( typeof str !== 'undefined' ) $self.find('.cff-text').html( str.replace("#hashtag1", "").replace("#hashtag2", "").replace("#hashtag3", "") );
});
support

Couldn’t find your answer in the docs?

Contact Support

Was this article helpful?