WooCommerce Remove WordPress Header lines - wordpress

I am just about to launch an eCommerce site using WordPress and WooCommerce and trying to tidy up the source code and strip out all the WordPress header lines.
The site is pure eCommerce with a blog for users and search engines, I believe the functions below are for a pure blog website.
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="http://www.domain.co.uk/xmlrpc.php"/>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.domain.co.uk/xmlrpc.php?rsd"/>
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.domain.co.uk/wp-includes/wlwmanifest.xml"/>
Does anyone know what is required from the above for WordPress to function? And how we can remove these from WordPress, if we can?
Thanks Kindly.
J

You can safely remove all of these from your header.php file. They aren't required for the site to function.
More info: In HTML5, the "profile" attribute was dropped.
The others are purely optional.
For de-registering the bottom two, you'll need to add some new lines to your functions.php:
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
These functions, from the wp_head action hook, can be viewed in wp-includes/general-template.php, starting on line 2190.
From this file, rsd_link "display(s) the link to the Really Simple Discovery service endpoint."
The wlmanifest_link "display(s) the link to the Windows Live Writer manifest file." If you don't use Windows Live Writer, there's no need for this.

Related

How to remove pingback tag xmlrpc from wordperess

whatever plugin I have installed this evil tag always is displayed in the output
<link rel="pingback" href="/xmlrpc.php">
is there any solution to get rid of it?
Solution, edit file wp-includes/general-template.php
Search for function rsd_link and case 'pingback_url': and comment the lines referred to xmlrpc
DONE!

WPML: hreflang is not implemented correctly

I am using WPML for my multi-lingual wordpress site. I am having an issue getting the hreflang attribute to be implemented properly.
According to this article:
https://support.google.com/webmasters/answer/189077?hl=en
The hreflang tag must include not only the url of the translated page, but also the url of the current page. For example, when I am on https://example.com the href tags should be as follows:
<link rel="alternate" hreflang="en" href="https://example.com" />
<link rel="alternate" hreflang="de" href="https://example.com/de" />
This seems to be the correct implementation, however when using WPML v 2.9 only the translated hreflang tag is displayed. For instance when I am on https://example.com it only shows the following:
<link rel="alternate" hreflang="de" href="https://example.com/de" />
I have ticked both options in WPML > Languages > SEO Options:
x Display alternative languages in the HEAD section.
x Add links to the original content with rel="canonical" attributes.
Perhaps I have misunderstood and having a canonical tag like this:
<link rel="canonical" href="https://example.com/" />
will suffice as the current page's hreflang tag. Thanks for any input.
I'm using WPML v3.1.8.4 and it's working fine for me. Can you try upgrading to the newest version?
I guess this may be a conflict between WPML and another plugin - seems WordPress SEO. I saw it somewhere in WPML Support Forum
If you are using Yoast Wordpress SEO and WMPL, juste add the following in your functions.php
add_filter( 'wpseo_canonical', '__return_false' );

Bonno WordPress Theme Caching CSS updates indefinitely

Recently I purchased a WordPress Theme called "Bonno" (http://bonno.aisconverse.com/). It's a great theme, but there seems to be one major drawback: Anytime you make a stylistic change to the style.css (via the Appearance --> Editor), the update will not occur.
I've tried:
Shift + R on a browser
Installing a plugin to clear the cache (WP Super Cache)
Making a post on a completely different page via Post/Update (this
sometimes works, other times does not -- not sure how or why)
Has anyone else encountered similar issues on Bonno? Or any other WordPress themes?
To solve this problem your can add extra string right after the filename using a ? character.Edit the theme file to change the link tag.
Example-
<link rel="stylesheet" type="text/css" href="style.css?123">
However it gets static and next time if you change the CSS again you might not get the update instantly. For this, you can use PHP to add the string dynamically by using time() function.
<link rel="stylesheet" type="text/css" href="style.css?<?php echo time(); ?>">
And now you can get instant update of your changes. This will not affect your CSS file.

Linked Stylesheet in WordPress

I am trying to build a second .css file for my company's website.
Currently, we are using a responsive theme, so most of our content displays correctly on desktop and mobile browsers. However, recently the boss is requesting custom code that is unresponsive. In order to keep the site looking good, I want to apply a secondary stylesheet that contains formatting for mobile devices. It would be like this for any html page:
<link rel="stylesheet" href="http://domain.tld/mobile.css" type="text/css" media="handheld" />
I cannot figure out how to get this into a wordpress child theme correctly. Can anyone offer suggestions?
Thank you in advance.
Look for the header.php file in your child theme directory, or under "Appearance"->"Editor" in the main menu of the your Wordpress adminpanel. You can paste the link to your new stylesheet there.
Also consider moving the styles to your theme's directory and replacing the domain in your href with <?php echo get_stylesheet_directory_uri(); ?> (example from wordpress codex).

How do you find what wordpress theme someone is using?

How do you find what theme someone is using, for example what theme does the official wordpress blog use?
Here are the links :
http://en.blog.wordpress.com
http://en.blog.wordpress.com/2006/08/17/forgotten-birthday/
The theme being used is called h4.
You can find this out by looking at where the style sheet is located. The style sheet code from this page is
<link rel="stylesheet" type="text/css" href="http://s2.wp.com/wp-content/themes/h4/style.css?m=1345845332g&5" media="screen" />
so you can see that the theme is stored in wp-content/themes/h4.
I would assume that h4 is a custom theme and wont be available publicly though.
Edit
This website is also useful for finding a wordpress theme as you just stick in the url and it pulls all the meta information (if there is any) from the CSS for you.
http://whatwpthemeisthat.com/

Resources