How do I stop Wordpress from inserting a noindex meta tag? - wordpress

I'm trying to get my website to be indexed by search engines. According to this, something from Wordpress is injecting a meta tag that's preventing search engines from crawling my site: https://aw-snap.info/file-viewer/?protocol=secure&tgt=chrispokey.com
I'm beginning to think it's something to do with the wp_head(); function. What next steps can I take to remove the noindex tag that's somehow getting inserted in my website's header section?
Thanks!
<?php
if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
wp_head();
?>

Please visit Settings » Reading and make sure you don't have checkbox checked near the "discourage robots" setting.

Related

Wordpress - Ajax Load More, showing tags

I am using Ajax Load More plugin for showing post. I want to show tags on my posts. Does any know how can I do that. I wrote a shortcode.
My custom tags
<?= do_shortcode('[ajax_load_more
container_type="ul"
post_type="it_news"
images_loaded="true"
placeholder="true"
progress_bar="true"
progress_bar_color="ed7070"
posts_per_page="9"
button_label="Voir plus d\'articles"
]')
?>
I tried to add tag = "true" to the parameters but it does not work, it shows nothing.
Any idea please ?
Thanks !

How to add canonical URL to post or page from custom field?

I'd like to skip using SEO plugins for adding canonical URL to some of my posts and pages. I've thought about creating a custom field which I would then populate only when needed.
I've looked around and I've found a very old answer on Stack overflow so I'm not sure if this is still the best way to do it.
On page Canonical URLs In Wordpress I've found the following code:
function canonical_r(){
if( !is_admin() ) {
$canonical_raw = (get_post_meta(get_the_ID(), 'canonical', true));
if ($canonical_raw) {
$canonical_url = preg_replace('/https*:\/\/|\s/', '', $canonical_raw);
?>
<link rel="canonical" href="<?php echo 'https://'.$canonical_url; ?>" />
<?php }} }
add_action('wp_head', 'canonical_r');
I guess that it could work, but it requires a child theme. I'd like to avoid that if it is possible.
Can this be done without a child theme? I used to use Toolest plugin for such things, but I don't have it available on the current project.

Yoast plugin is not showing meta description and meta keyword

I am a newbie and learning new things every now and then. I recently set up Yoast on my WordPress website and I put title, focus keyword, and meta description for every single page of my website manually in Yoast widget. This shows up under the page but unfortunately the meta description and keywords is not appear on the page source.
In fact throughout the website same title and description is displayed. Is there any additional configuration required after installation of Yoast in header.php or somewhere in files?
You can add code to functions.php for showing focus keywords as meta-keywords in section of the page.
function set_head_keywords() {
$id = get_the_ID();
if (!$id) return;
$meta = get_post_meta( $id, '_yoast_wpseo_focuskw', true );
echo '<meta name="keywords" content="'.$meta.'" />';
}
add_action( 'wp_head', 'set_head_keywords' );
Answer from Yoast seo plugin is stated below:
We’ve removed the meta keywords feature in Yoast SEO from version 6.3. Meta keywords haven’t had a use for a long time, so their removal from our plugin has been long overdue.
Reference: https://kb.yoast.com/kb/meta-keywords-yoast-seo/
Google:
Google does not use the keywords meta tag in web ranking.
Reference: https://webmasters.googleblog.com/2009/09/google-does-not-use-keywords-meta-tag.html
Yahoo! Announced they no longer use the meta keywords tag anymore either.
Bing:
On 2014: Today, it’s pretty clear the meta keyword tag is dead in terms of SEO value. Sure, it might have value for contextual ad systems or serve as a signal to ‘bots plying the web looking for topics to target, but as far as search goes, that tag flat lined years ago as a booster.
Reference: https://blogs.bing.com/webmaster/2014/10/03/blame-the-meta-keyword-tag

Finding the content for a page

I'm trying to make a change to an existing wordpress site. The main page is generated by the following:
<?php
get_header();
the_post();
if( get_post_meta( $post->ID, '_ebor_disable_header', true ) !== 'on' )
get_template_part('loop/content','pagetitle');
the_content();
get_footer('onepage');
I've verified this by ripping out the_content() and seeing the page go mostly blank. However, I can't find where the content is stored.
Searching in the database is returning nothing (udz_posts table), and it doesn't seem to be in the source files. Is there a way to determine where its fetching the content from?
I'd like to help you out. Is this the code for the homepage? If yes, and you would like to edit the content of it. It really depends on how it is set up. But you can actually right an HTML code in there to make it appear. However, to maximize the use of wordpress, you can set a page to be the homepage and add content there.

WordPress home page title

My homepage's title is being displayed as the title of the last blog post created.
The code is:
<title><?php bloginfo('name'); ?></title>
So from my understanding that should display the blog title (set in general settings) on the homepage.
But its not. Its displaying the most recent post title.
What do i need to look for?
wp_title() is used to display the title of the page being displayed, but it uses the query results to get its value. So if you are executing a loop on many posts (which you obviously are on your homepage) and you don't reset it, you will get the title of the last post in your loop... logical.
Besides, note that the homepage is index.php in your theme, it is not a real page in WordPress. So it hasn't got a title. So wp_title() can't be of any use for you here.
Basically, your homepage has not got any title. So if this template is both for your homepage and other pages, you need to do a conditional check :
Is this homepage? (use is_home())
A. Yes, echo "Welcome on my great website"
B. No, wp_title(), which will echo the title of the page you are on...
Do you get it?
First off, you're executing two functions here -- wp_title, which retrieves the title of the page the visitor is currently on, and thereafter bloginfo, which with the argument 'name' indeed fetches your blog's name as set in the configuration.
However, there's a slight error in your code; you'd get the desired result as follows:
<title>
<?php
wp_title('|', true, 'right');
bloginfo('name');
?>
</title>
You should read about the parameters for wp_title on the WP Codex; the | gives you a delimiter, for example, and 'right' tells the function where to output said separator.
Note: I'd advise you to display both the post title and blog name, as only the blog name on every single page is both unhelpful for visitors and yields por results in search engine results.
I found your problem! Error in your code : remove > after <?php (you have written <?php>) so this :
<?php> bloginfo('name'); ?>
should now become this :
<?php bloginfo('name'); ?>
And it will work !

Resources