13 cara mengamankan wordpress anda

1. Create Custom Login Links

It is very obvious that in order to access the WordPress admin panel, all one has to do is type in the url of the site with /wp-login.php. Now if you used a same password in more than one location, and it was jeopardized then it is easy for the hacker to hack your site. A plugin called Stealth Login allows you to create custom URLs for logging in, logging out, administration and registering for your WordPress blog. You can also enable “Stealth Mode” which will prevent users from being able to access ‘wp-login.php’ directly. You can then set your login url to something more cryptic. This won’t secure your website perfectly, but if someone does manage to crack your password, it can make it difficult for them to find where to actually login. This also prevents any bots that are used for malicious intents from accessing your wp-login.php file and attempting to break in.

2. Pick a Strong Password

This is a very obvious step, but we must mention it as it can’t be emphasized enough. Do not use the same password in other places. Try to make each password different and hard to guess. Use the WordPress Password Strength Detector to your advantage and make your password strong. Another thing you want to do is change your password periodically, so even if some has guessed your password, it is useless to them once you have changed it.

Continue reading

Mengkunci www pada url website pakai .htaccess

Code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*) http://www.mydomain.com/$1 [L,R=301]

copy kode di atas pada .htaccess dalam root website kamu, kalau .htacess belum ada silakan buat sendiri. Dalam kode rewrite di atas setiap user masuk lewat mydomain.com akan langsung diredirect 301 menuju http://www.namadomain.tld

Trus apa keuntungannya mengkunci www.?
Sebenarnya ini adalah salah satu teknik seo, supaya tidak terjadi duplicate indexing pada website kamu. Selain itu kamu juga bisa memilih selalu memakai www (www.namadomain.tld) atau selalu tidak memakai www (http://www.namadomain.tld). Gw sendiri memilih selalu memakai www karena penggunaan www sangat umum dipakai. Tapi sebelum mencoba kode di atas coba dulu apakah http://namadomain.tld dan www.namadomain.tld meunuju tempat yg sama

Selamat Mencoba!!!

contoh plugin wordpress related post

Setelah membuat tutorial ini maka saya lanjutan untuk pembuatan cara pembuatan plugin wp sederhana yaitu rlated post

//related post shortcode
function related_posts_shortcode( $atts ) {

    extract(shortcode_atts(array(
        'limit' => '5',
    ), $atts));

    global $wpdb, $post, $table_prefix;

    if ($post->ID) {

        $retval = '
<ul>';

        // Get tags
        $tags = wp_get_post_tags($post->ID);
        $tagsarray = array();
        foreach ($tags as $tag) {
            $tagsarray[] = $tag->term_id;
        }
        $tagslist = implode(',', $tagsarray);

        // Do the query
        $q = "
            SELECT p.*, count(tr.object_id) as count
            FROM $wpdb->term_taxonomy AS tt, $wpdb->term_relationships AS tr, $wpdb->posts AS p
            WHERE tt.taxonomy ='post_tag'
                AND tt.term_taxonomy_id = tr.term_taxonomy_id
                AND tr.object_id  = p.ID
                AND tt.term_id IN ($tagslist)
                AND p.ID != $post->ID
                AND p.post_status = 'publish'
                AND p.post_date_gmt < NOW()
            GROUP BY tr.object_id
            ORDER BY count DESC, p.post_date_gmt DESC
            LIMIT $limit;";

        $related = $wpdb->get_results($q);

        if ( $related ) {
            foreach($related as $r) {
                $retval .= '
    <li><a title="'.wptexturize($r->post_title).'" href="'.get_permalink($r->ID).'">'.wptexturize($r->post_title).'</a></li>
';
            }
        } else {
            $retval .= '
    <li>No related posts found</li>
';
        }
        $retval .= '</ul>
';
        return $retval;
    }
    return;
}
add_shortcode('related_posts', 'related_posts_shortcode');

dari kode diatas yg di modif hanya menambahkan identifikasi, merubah

return $retval;

jadi

//related post shortcode
return get_the_content().’relatedpost’
Related Posts:
‘.$retval.”; // menambah get_the_content() dan format html

dan menambahkan kode dibawah untuk memodifikasi the_content

add_action(‘the_content’,'related_posts_shortcode’);

Referensi

1 & 2

tekhnik dasar Pembuatan plugin WordPress

Kadangkala untuk memodif wordpress biasanya kita edit2 themenya terutama yg sering di edit adalah functions.php nah daripada klo nanti themenya di ganti trus themenya di otak atik lagi mending kita bikin pluginnya aja.

dalam contoh kali ini ane akan bikin “List Tags tanpa link” karena kmren2 SEO booster Pro disalah satu post ane ngasilin tags sampai ribuan dan ini ga baik bs menyebabkan penalti google makanya linknya harus dihapus, biasanya klo manual tinggal replace <?php the_tags(); ?> dengan kode di bawah ke single.php atau bisa juga di index.php atau archieve.php

< ?php $articletags = strip_tags(get_the_tag_list('',', ','' )); echo $articletags; ?>

tapi klo untuk dibuat plugin wordpress buat file berekstensi php dan masukan identifikasi dibawah ini tepat dibawah kode

  1. < ?php
  2. /*
  3. Plugin Name: List Tags tanpa link
  4. Plugin URI: http://www.ipangsan.web.id/
  5. Description: Menampilkan list tags tanpa link jika ada fungsi the_tags (single.php, index.php)
  6. Author: creatorVersion: 0.1
  7. Author URI: http://www.ipangsan.web.id
  8. */
  9. ?>

kemudian masukan kode
add_action('the_tags','strip_tags');

strip_tags diatas adalah fungsi php untuk menghilangkan kode html temasuk link dan komplit kodenya

Continue reading

mengubah maksimum upload file pada wordpress

Pertama-tama untuk cek nya buat file info.php pada halaman public_html di web anda

isi dengan code berikut
?

Setelah itu cek berapa maximum upload file nya, standard nya sih 2 MB..

Nah disini trick nya, bikin php.ini pada halaman yang sama lalu taruh code nyta sbb :
upload_max_filesize = 10M
max_execution_time = 360
max_input_time = 120

Buat jaga-jaga gw bikin kaya gitu..
pada bari upload max tersrah kalian mau di ubah berapa ukuran nya..case disini aye pake 10 MB

setalah itu simpan, dan jangan lupa copy file php.ini ke alam directory wp-admin

Thx