Title: Filtering and replacing content
Last modified: January 17, 2021

---

# Filtering and replacing content

 *  [aabdinzainul](https://wordpress.org/support/users/aabdinzainul/)
 * (@aabdinzainul)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/filtering-and-replacing-content/)
 * Thank you for creating such a wonderful WordPress plugin. I love Zotpress.
    I
   understand that using custom CSS I can customize the bibliography on my webpage.
   However, I would like to hide the abstract initially, and then when a visitor
   clicks on show abstract then it should be visible. For this purpose, I am trying
   to filter the content of the [zotpress] shortcode, however, a simple filter does
   not work. I tested the same code it does work on the other content on the same
   page.
 *     ```
       function za_zotpress_shortcode_filter($output, $tag, $atts, $m) {
       	if ($tag === 'zotpress') {
       		return str_replace("Abstract", "New Abstract", $output);
       	}
       }
       add_filter('do_shortcode_tag', 'za_zotpress_shortcode_filter', 10, 4);
       ```
   
 * Thank you very much, any help will b highly appreciated!!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Mark](https://wordpress.org/support/users/codeispoetry/)
 * (@codeispoetry)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/filtering-and-replacing-content/#post-13922179)
 * I think you could do the hiding and showing with CSS alone along the lines of
   this solution: [https://dabblet.com/gist/1506530](https://dabblet.com/gist/1506530)
 * So you’d load all of the abstracts without filtering, then display:none with 
   CSS, and use a toggle to set the display status. This would require no filtering
   at WordPress level.
 *  Thread Starter [aabdinzainul](https://wordpress.org/support/users/aabdinzainul/)
 * (@aabdinzainul)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/filtering-and-replacing-content/#post-13922737)
 * Thanks for the reply, Mark. Thanks for the link to the CSS trick. If I understood
   it correctly then this way I will be able to show/hide all of the abstract simultaneous,
   not a particular one. I want to show a link (Show Abstract/Hide Abstract) for
   each of my publications in the bibliography. I like the plugin because it very
   powerful particularly at the backend it does a very nice job. However, at the
   front end, I am not satisfied so I wanted some tweak.
 *  [Mark](https://wordpress.org/support/users/codeispoetry/)
 * (@codeispoetry)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/filtering-and-replacing-content/#post-13954727)
 * No, it can also be at the level of abstract, as there is no limit to the amount
   of toggles you can have. E.g. the toggle could be a placeholder “Abstract”.
 * I suppose folks more well-versed in Javascript could also fix it that way; it
   doesn’t need to be CSS. The main thing I’m saying is that it’s probably not a
   great idea to do it at the level of WordPress content filters, as they necessitate
   a new database query (and hence page load) every time a new abstract is needed;
   whereas loading them all at once and then manipulating their visibility is going
   to be faster, easier to cache, etc.
    -  This reply was modified 5 years, 3 months ago by [Mark](https://wordpress.org/support/users/codeispoetry/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Filtering and replacing content’ is closed to new replies.

 * ![](https://ps.w.org/zotpress/assets/icon-256x256.png?rev=1995512)
 * [Zotpress](https://wordpress.org/plugins/zotpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/zotpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/zotpress/)
 * [Active Topics](https://wordpress.org/support/plugin/zotpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/zotpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/zotpress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mark](https://wordpress.org/support/users/codeispoetry/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/filtering-and-replacing-content/#post-13954727)
 * Status: not a support question