Title: Remove code via css
Last modified: May 25, 2019

---

# Remove code via css

 *  Resolved [acqua](https://wordpress.org/support/users/acqua/)
 * (@acqua)
 * [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/)
 * Hello community!
    I am using a plugin to import articles from an rss sources.
   My issue is that an embed video gets imported with just its code. I am not interested
   in the video itself so I am trying to remove the code via css.
 * Couple of articles imported:
    [https://interfans.org/lukaku-la-trattativa-procede-spedita-linter-ha-laccordo-col-belga-con-lo-united/](https://interfans.org/lukaku-la-trattativa-procede-spedita-linter-ha-laccordo-col-belga-con-lo-united/)
   [https://interfans.org/inter-e-chiesa-il-primo-regalo-per-conte-ecco-la-carta-per-convincere-la-fiorentina/](https://interfans.org/inter-e-chiesa-il-primo-regalo-per-conte-ecco-la-carta-per-convincere-la-fiorentina/)
 * The code that needs to be removed is:
    [fncvideo id=971437 autoplay=true] [fncvideo
   id=811227 autoplay=true] that appears right below the feature image.
 * Can you help me?

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

 *  [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/)
 * (@crouchingbruin)
 * [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/#post-11572335)
 * The only way you’re going to be able to add a CSS rule to hide those codes is
   if every single article has the same code in the same place. That is, because
   the container for the shortcode doesn’t have a class or ID associated with it(
   or any other attribute), then you can’t create a specific selector for a CSS 
   rule to act on.
 * Now, if all of your imports have the same structure, i.e., they all imported 
   in that same code in the same place, then you could add a rule like this:
 *     ```
       .single-post .td-post-content > p:nth-of-type(2) {
          display: none;
       }
       ```
   
 * That rule hides the second paragraph on all blog posts, which is where the shortcode
   is appearing on the two examples you’ve posted. The problem is that if the shortcode
   doesn’t appear on the post, then the rule will hide a paragraph that probably
   has information that you need to display.
 * Probably the best thing to do is add some Javascript that searches and removes
   all paragraph elements which have that fncvideo string.
    -  This reply was modified 7 years ago by [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/).
 *  Thread Starter [acqua](https://wordpress.org/support/users/acqua/)
 * (@acqua)
 * [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/#post-11572768)
 * Thank you for your reply much appreciated
    I will go with the js that search 
   and delete that code Any plugin available?
 *  [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/)
 * (@crouchingbruin)
 * [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/#post-11572830)
 * You can use a plugin like [Simple Custom CSS and JS](https://wordpress.org/plugins/custom-css-js/)
   to add your own Javascript. Once you install and activate the plugin, add a custom
   JS module, and add this code to it:
 *     ```
       jQuery(document).ready(function($) {
   
          $("p").each( function(index) {
             strText = $(this).text();
             if (strText.indexOf('fncvideo') != -1) {
                $(this).remove();
             }
          });
   
       });
       ```
   
 * This will remove all paragraphs with the string _fncvideo_.
 *  Thread Starter [acqua](https://wordpress.org/support/users/acqua/)
 * (@acqua)
 * [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/#post-11572858)
 * Oh your code works great!
    This got fixed my issue thanks a lot

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

The topic ‘Remove code via css’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [acqua](https://wordpress.org/support/users/acqua/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/remove-code-via-css/#post-11572858)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
