Create a function in functions.php to see if your title part is in an array of ‘banned’ words:
function check_word( $word )
{
$blacklist = array('the', 'it', 'and', ...);
if ( !in_array( $word, $blacklist ) && strlen( $word ) > 3 ) {
return $word;
}
else {
return '';
}
}
Run your title words through it. It’ll only print a word if it’s not in the blacklist.
$title = get_the_title();
$parts = explode( ' ', $title );
echo check_word( $parts[0] );
echo check_word( $parts[1] );
echo check_word( $parts[2] );
Tweak to taste.
Related Posts:
- How to get page’s ID if I know the title only?
- Multiple Conditions for Child Page Title
- How to sanitize post title with commas
- change title separator
- Blog Title not showing up on main Blog page
- Replace text in the Title
- How come I get internal server error even with try catch for get_the_title in functions.php?
- Print title page in header of a specific page
- Generate page title tag from the content of H1
- Using php to overwrite or replace title tag, while using yoast [closed]
- Two title tags in my header
- How can I add title attributes to next and previous post link functions?
- Changing title of a page dynamically from within a plugin
- How to add subscript and superscript in WordPress page titles
- add_theme_support( ‘title-tag’ ) in conflict with custom titles function
- Modify page title format (when using title-tag)
- Empty title on front page/Home
- Changing “Enter title here” based on post format
- WordPress i18n-friendly preg_replace post title
- How to make a H1 different then the Title?
- How to set custom title of custom page template?
- How do I edit the tag without using the deprecated `wp_title()` function?
- Change Default Custom Fields Metabox Name
- Get wp_title() from page ID into a variable
- Remove site name from tag
- SEO meta description and title tag Yoast SEO
- What code do you use to generate the text to go into the HTML title tag?
- How come my first blog post and my home page have the same title?
- How to intercept Post Title on Post-Save
- Where do I change the ACTUAL title tag that is set in the header.php
- Why doesn’t YoastSEO allow me to set the title/description for the home page? [closed]
- Change title tag dynamically or within plugin?
- Remove site name from title post
- Hide price & title in store thumbnail dispay? [closed]
- How do I set the blog name?
- Add anchor text to php
- Set max title length – similar to excerpt length for outside of single.php
- How to edit title on Edit post pages?
- How do I shorten the title lenghs with Elementor theme? [closed]
- Automatically add words if duplicate post titles
- Remove Title of youtube video
- How to add H4 tag to the_content filter (after content)?
- HeadSpace2 double title on homepage
- Page title is showing category name as well in the google search results
- Modify conditional titles to include parent and page number
- Why is a category/ tag name prefixed to title of every page?
- Where does Yoast SEO plugin sets the site/page title?
- How to output the title of the blogs home page
- After I set the title, it over-wrote all the titles for the individual pages
- Cannot use ‘CSS’ in post title
- Wrap the_title_attribute in a H2 within a Conditional Tag?
- How to echo all the_title() without text after last “-“
- set title attribute in wp_get_attachment_image()
- get_the_title outputs title until spacing; it does not get full length of title
- Title tags show twice
- How can I override the post title when a post is set to sticky? [closed]
- disallow publish posts with special title
- How to get current page title inside a page’s template
- Permalink and ACF field
- Remove tagline from the HTML on the home page without plugin?
- Prefix the title tag, if IP address is the dev server
- how to set alt & title for featured image get_the_post_thumbnail
- Change meta data of pdf file
- How can I add a title to this ‘maintenance mode’ function?
- Front page displays different than all other pages?
- Modify link options when hovering over post title
- Wp Admin Bar Customizing Labels
- WordPress title as keywords (tags) with excluded stop words
- Array to modify post titles
- Title how does page no work in Twenty Eleven
- strtolower
- Getting the Image Title (not the post title)
- how to change the title of tag page?
- I want to add number after post tittle for each category
- Add text to the first “title”=>get_the_title($post->ID), and shorten
- Special characters in post_title replaced by ‘?’
- Display text if title in archive has specific word
- Limit title length
- Remove title bar from post-new.php
- How do you change the title of the Edit Post page?
- How to get page title () in a different order?
- Reorder title tag and description tag with wpseo_title and wpseo_metadesc
- How can I remove an unwanted character from the main page’s title?
- How do you keep the title of a post. to NOT show when publishing the post?
- Custom title when using shortcode
- Change font and Colours in Menus
- Setting Page Title Yoast
- How to Implement Category.php page title in wordpress custom template?
- Why I can not modify the appereance of my title web site in google? [closed]
- Comparing pre-saved post_title to post-saved post_title
- Hide H1 Title using the_title filter
- Add Placeholder in WordPress Editor Content Box
- Get post title of faulty link on 404 error page
- How to delete posts which have same title?
- Append text after wordpress title
- How to add … after a particular word/character limit to the title
- reformat entry-title with two different styles
- Show page name in browser
- Trying to get more space removed from my header
- Title displaying multiple times