Showing posts with label seo. Show all posts
Showing posts with label seo. Show all posts

Thursday, February 23, 2017

How to parse XML in PHP – simpleXML

Hello all,

Many websites on internet like to share their feed in XML format so that other website owner can show that feed on his/her website / blog. In PHP there is a function called simpleXML can simplify the process of reading the feeds into something useful for your web pages.

 If You have wordpress installed in your server you can also on Rss feed of your blog and share your news/ articles with other websites. this will increase your blog visibility and good for SEO also.

Here is sample xml file.
companydb.xml

<?xml version='1.0'?>
<companydb>
  <company>
        <name>Chirag</name>
        <city>Ahmedabad</city>
        <phone>121212</phone>
  </company>
    <company>
        <name>Parmar</name>
        <city>Mumbai</city>
        <phone>121212</phone>
  </company>
</companydb>
 With simpleXML, it’s as easy reading the XML file and then accessing it’s contents by an easy to read object. Suppose we have our XML file above saved as a file called comopanydb.xml with all the company details in the same folder as our php file, we can read the whole xml feed by following php function.

$companydb = simplexml_load_file('companydb.xml');
 
Now we have created file object, go next for accessing it’s content. 
like if you want to display the name of the all companies then use below
 code.
 
<?php
    $companydb = simplexml_load_file('companydb.xml');
    foreach ($companydb as $company) {
        echo $title=$company->name." - ".$company->city." - ".$company->phone."<br/>";
  } 
?>
 
Above is the quick example for parsing xaml data in php, you can store you 
data in xml file and access with this method.  
 

Thursday, February 2, 2017

The best way to SEO a wordpress site

Get Yoast all-in-one, configure it with Google Webmaster Tools and Analytics. Secure it. Harden it. Nothing worse for SEO than getting hacked.

No website can perform better without SEO. In fact, SEO becomes important to get the web visibility. It is true that not every website can rank on the search engine with every keyword yet, we could optimize some of the keywords in a way to get organic traffic.
SEO can be performed on any of the platforms yet, Word press seems to be more effective due to easy CMS based Systems and Free Plug-Ins. Here are some of the optimum ways to optimize the website:-
1) First of all, you are required to Install and activate the Yoast SEO Plug-in which is quite easy to use and understand.
2) Optimize the Pages, Posts, Images through Title, Meta tags, Meta description, Alt tags etc.
3) Check out the quality of content and maintain optimum keyword density. Keyword stuffing should be avoided.
4) Integrate Blog section and post content on weekly basis. Make sure to optimize each blog post and images
5) Perform Interlinking, yet avoid too much or interlinking.
6) Fetch Homepage URL and relevant URL through off page techniques like Directory submission, social bookmarking, business listing, profiling and all.
7) Make more emphasis on Content marketing through Article Writing, Blog Writing, and Guest Post etc.
Like another website, Word Press can be promoted easily due to its user-friendly, mobile-friendly and SEO-friendly activities.


To get setup
  1. Google Webmasters - Support, Learn, Connect & Search Console - Google
  2. Google Analytics
  3. Use PageSpeed Insights to measure page load times - very important
  4. All In One SEO Pack to WordPress SEO Migration • Yoast
  5. Create a twitter, facebook, LinkedIn page(s) as necessary
  6. Join some subject matter fora (forums), groups etc on Linkedin, G+
  7. Setup a ranking report to see how you’re site is doing
  8. Consider buying into a tool like service for competitors research, shows organic and Ads keywords for any site or domain
When you write a post
  1. Think of an interesting title - with the most attractive keywords or ideas or elements
  2. Add an image; optimize the site for social sharing
    1. Alt Text
  3. Set a relevent category
  4. Share it and post it on some of your channels