SEO Optimization Tips for WordPress

艾瑞可erik I’ve been working on website optimization lately. The response speed test in Baidu Analytics is already fully maxed out at 100%, and only the Baidu Webmaster page optimization is stuck at 92 points. To the peers who aren’t willing to spend time on optimization, I’d like to say, “Keep at it — I’ve already done it.” When you run into a problem and search Baidu, you’ll find plenty of forum posts or blogs saying you don’t need to bother with the optimizations in Baidu Analytics — that merging domains, merging js and css, none of it works, isn’t necessary, barely makes a difference. If it really barely made a difference, does Baidu itself have a problem, deliberately evaluating you wrong to mislead you? 艾瑞可erik It’s all tears when you talk about it. The Baidu Analytics website response test was a real headache at first. It said js and css needed merging, externally loaded image domains needed merging, the website cache response time needed to be set…… so many problems. 木木夕 Since there are all these problems, let’s just fix them — staring at them doesn’t help. I went to Baidu first to look around, and after a while of fussing about I found Baidu unreliable, and lots of people hadn’t done it either. So what to do? Let’s start with merging the css. What Baidu Analytics warns about is that your code has multiple css files (mine had 2). In the admin Appearance - Editor - header.php file there were none of these css files; only after looking things up did I learn that they’re output by <?php wphead(); >. So what to do? After thinking it over, I got a result. First I went to the site’s homepage and viewed the source file [![木木夕](http://img03.taobaocdn.com/imgextra/i4/809419769/TB2.V40aVXXXXXyXpXXXXXXXXXX!!809419769.png)](http://img03.taobaocdn.com/imgextra/i4/809419769/TB2.V40aVXXXXXyXpXXXXXXXXXX_!!809419769.png) The source file parses out all the code, which is great. Then we go back and comment out the <?php wp_head(); > in the header.php file, look at the surrounding code to find the joins, and copy-paste the code that the source file outputs in place of <?php wp_head(); > into the corresponding position in header.php. Then you’ll find the css files that need merging, and also the js files that need merging. We comment out one of them first and leave the other to be called (script apparently can’t be commented out, so just paste and copy it to a local file first, so it’s easy to restore if something goes wrong), and update the header.php file. Use ftp to connect to the server and find the corresponding files. For example, on my side style.cc and 960.css, jquery.js and jquery-migrate.min.js needed to be merged; I first found where these files correspond, downloaded them locally to make a backup (note that the folder jquery lives in has quite a few files, so look carefully). I copied and pasted the code inside 960.css into style.css, and at the same time commented out the link path in the header.php file (note: don’t delete the 960.css file, because other places are calling it). In the same way, merge the js files too. Finally, clear the website cache (if you have a cache plugin installed you need to clear the cache), then clear the browser cache, then run the Baidu Analytics test and you’ll find the response speed score goes up. 木木夕 木木夕 But we’re not done yet, because there are still domains to merge. The answers I found searching on Baidu said domains can’t be merged, that they’re all external calls to someone else’s. Some even said you need a top-level domain to merge them — I’m speechless at these people. 木木夕 Externally loaded images can’t be helped — the space isn’t big, and images take up too much room, so they have to be loaded externally. I kept thinking about this problem when building the site, and later solved it. Since I’ve worked with Taobao, I have a Taobao image space and can call external links from it. What Baidu Analytics flags as domain merging is img03.taobaocdn.com and img04.taobaocdn.com being different only in the front part; change the front part to the same and try it — and it really worked, without affecting the image output. Merging domains was solved just like that. In the same way, the 360 friend links and security check verification I call also use this method; refresh the cache and test again, and there’s no more domain merging to worry about. 木木夕 What I want to say here is that with some things, you really only learn there’s a better way to solve them when you try for yourself. Even though you start with Baidu, once you try it yourself you’ll know what the result will be.