The following regex should do the trick to select all instances of the videopack
shortcode, including contents: \[videopack.*?\[\/videopack\]
$post_description = preg_replace( '\[videopack.*?\[\/videopack\]', '', $post->post_content );
Related Posts:
- WordPress 302 Redirect to Random Product/Post/Page
- get category in list of posts // shortcode for custom related posts
- shortcode // get posts by ids
- Function is printing twice – any suggestions?
- Insert Shortcode exactly at the end of the content
- How to use shortcode to get the second to newest post?
- Stop WordPress automatically adding tags to post content
- How to change the case of all post titles to “Title Case”
- How to detect single.php (but not single-portfolio.php)?
- Function to execute when a post is moved to trash .
- Changing the post date and time with function
- Get current post id in functions.php
- WordPress removing tags?
- Dynamically add id to heading tags
- disable WP automatically inserted line breaks after an image
- Getting the post_id in wp_ajax function
- Shortcode to display the latest news article within a page
- Redirect to another page using contact form 7? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- Shortcodes on my website stops working after theme update [closed]
- How to get ID of the page included with get_page()?
- Change all author links in Blog roll
- How to get a post’s details by shortcode?
- disable Tab post on nav-menus page (Admin)
- Adding bootstrap classes to video shortcodes
- Every second post different class in blog view
- Format latest/newest post differently
- is_page Funtion for Posts ?
- Post type no single page
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- The_excerpt() doesn’t parse – how to change that?
- How to only publish posts with image in it
- Isn’t the way posts are displayed very unefficient?
- Add custom text automatically on each post
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- How come a YouTube link isn’t transformed into a shortcode inside the post content?
- Is it possible to add a shortcode below post title?
- restrict incrementation of post vies count when refreshing the page
- Defined function isn’t showed on page
- Getting Whitescreen when publishing a post [closed]
- Using system date format
- Get post by tag
- Add code to a specific post’s content
- Related Posts function not working
- the_content() Not Grabbing All Content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Related Posts: Changing Function For Posts Per Page
- How to convert query sql to shortcode in wordpress?
- How can I add 2 buttons with shortcode
- Why aren’t paragraphs breaking on this page?
- Query function not executed between element [closed]
- Optimize CPT-function with a loop
- HTML Inside of Shortcode Breaks Shortcode Output
- saving/reading custom field value does not work – no value gets POSTed
- Same post appears in related Posts?
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Have h2 tag not show up if there are no blog posts
- Shortcode for tables which can include comma and linebreaks
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Making a wordpress page print friendly
- post/page content
- Help on conditional statement to accompany wp_insert_post function please?
- How to implement a WordPress comments function?
- How to add content above footer in posts from specific category
- Set Default Post as Parent Child (Nested) Relation
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- Change published date and time using SQL query for page in every 5 hour
- how to show comments only author which send own posts in wordpress
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- Shortcode for Comments and Comment Boxes in Post Loop
- Display “no post” message
- How can I create a shortcode to show the number of posts of actual day?
- How to put the author of the post in the comments?
- Check if almost 10 year old – working code is up to date
- Alt text attributes not showing over portfolio images
- Featured Story Shortcode not outputting content
- Find most used words in post titles
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- $post->post_content empty while all other properties are correct
- How to pull sticky post permalink inside php?
- How to add a custom class attribute into code wrapper? [duplicate]
- Contact Form 7 Shortcode not recognized inside another shortcode
- Display Post from Custom Post Type with Shortcode
- wp_insert_post() Add and specific ID to the body of that
- Remove pagination if search returns empty
- Remove HTML tags from all posts
- Set a post expiration and delete a post when expirate
- Add a url parameter to the current post and read it in a shortcode
- I want to change the WordPress comments file
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- Save All Post Permalink From A Specific Category into a .txt file
- Secretly passing post ID/title etc into a shortcode form automatically to link submission to post
- Changing a users posts to drafts upon role change
- AJAX load more posts not using correct category and repeating the same few posts
- How to Display Most View Post in the template file?
- Get post id outside loop : Notice: Trying to get property of non-object