You can specify a search term in a WP_Query
or get_posts()
call:
$pages = get_posts(
array (
's' => '[shortcodename',
'post_type' => array ( 'page', 'post' )
)
);
Related Posts:
- How to add an admin notice upon post save/update
- Passing current cookies in wp_remote_get to get Draft Post Preview
- Including categories in search results
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Listen to Post action
- Manipulate post category after time
- Display all search results
- WooCommerce – Create Products Programatically [closed]
- Search posts by post author name
- How to get posts by content?
- Search not working with title and content
- which action to hook to in order to perform post-publish action
- Cannot access current post’s ID in custom plugin
- Set number of article per number of page
- how to hide specific post from google search
- How to change post status from publish to draft using hook in wordpress?
- prevent showing posts of an specific category in admin posts section
- How to search only by post title and category?
- Search widget breaks when using multiple loops?
- Pagination not working on custom query
- Using radio button meta data from a custom meta box
- How can I get all posts data from within a paginated search result?
- Search query – exact post title match
- pagination hook doesn’t work with search results
- Search for posts based on their url in the admin?
- wp_query ‘s’ parameter does not work with custom post type
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Differentiate between posts and pages in search results
- Global $post not working in OOP function WordPress
- Count search results in heading
- Private Posts/Pages & Search
- Display number of posts via adress bar?
- Tags to Post-ID mysql query. Tag Search
- Define a wordpress constant through plugin functions?
- How to change wordpress dates to native language (even if the languge not available i wordpress)
- How to get post bulk edit action trigger and get edited post ids?
- updating a post doesn’t trigger a function
- Hide a specific category in admin All Posts page (WordPress)
- Prevent Delete Attachment by URL or When Submit
- How to filter my search in post if contains a word in title, content or excerpt?
- What hook do you use to update a post?
- Search results posts_orderby and ID
- Updating post data on save (save_post vs wp_insert_post_data)
- Posts and Attachments with “Published” status in Search
- How do I change the core post search algorithm? Where is it found/constructed?
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- How to add add more properties to WP_Post object in search results loop
- Total number of posts in query (category/tag/author/search results/main page…)
- See if a post has a specified tag
- Filter Hook for post table (not columns)
- why str_replace targeting pages instead just targeting post?
- Get author posts count after excluding a category
- Stop post submission without losing data?
- Cant’ Grab WordPress Built-in Posts Through Loop
- How can my plugin display a populated new post window
- Why does WordPress search returns same number of results for every search query?
- Hide parts of the post content after typing it’s name or searching it by category
- How to exclude the word “class” from being matched in search?
- Finding a post’s slug
- Insert specific information to a posts of a predefined category
- Open a wordpress single post in a lightbox without the header and footer
- Will multiple category descriptions effect my search engine optimization?
- What would causes search to return incorrect results?
- I want to add another search box on posts page in dashboard
- Is it possible to get the specific content on the search page?
- Showing Posts if non are found
- search form for custom fields
- How to show posts in grid style on search result page?
- Search results with pagination not working
- Create a post automatically if search result has zero results
- How to show only homepage in google results instead of privacy, contact pages
- Redirecting wordpress search query to archive page
- WordPress: Develop multiple posts with different data
- How to search through “post title” and “tags” using WP_Query?
- How to create custom search form function including post “tags”
- Remove pagination if search returns empty
- How do i search post by jquery datepicker?
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- show only one category and filter by tag
- On WordPress Search, how to search post from Author meta also
- How to hide meta from search result only on pages?
- How do I change the post title’s link on the posts page?
- Update user meta when post published no working
- Find post tags words in post content and link them to tag URLs
- Custom author search
- Fixing the WP Post Object for Custom Route
- WordPress search for specific Post Type
- Display result of custom form
- Export Posts with specific custom fields by sql
- Custom plugin to get related posts by category
- Customize search results to include custom posts and display in a specific template page
- How can i retrive the movies, trailers, news in a single page using search
- Custom Post Title as search term
- Related posts by searching post tags of single post as terms
- Hide the contents for specific post
- Error 404 blog/page/2/
- How to get only post=’product’
- Onclick open posts displayed in slider in a popup [closed]
- Search doesn’t display posts with images
- How do I save JS classes being applied to the WP dashboard via custom plugin?