SEO 최적화 메타 구성하기 > 기술자료 | 해피정닷컴

SEO 최적화 메타 구성하기 > 기술자료

본문 바로가기

사이트 내 전체검색

SEO 최적화 메타 구성하기 > 기술자료

Search SEO 최적화 메타 구성하기

페이지 정보


본문

수정내역

2017-03-29  최초배포
2018-10-07  비밀글일때 본문을 추출하지 않도록 수정
2020-03-02  meta 추출 코드 전면 개편
2020-03-23  오타 수정
2020-11-12  seo_head.php 파일생성해서 head.sub.php 단순화처리
2022-11-25 그누보드5 / seo_head.php 파일 193라인 echoecho 중복 수정
2023-03-17 og:image 관련 수정


자신에 맞는 영역을 홈페이지의 <head>와 </head> 에 넣습니다.
디스크립션과 og태그를 동시에 입력하였을때는, 네이버검색시 og태그가 먼저 반영됩니다.
변경사항이 적용되기까지는 포털사 캐시정책에 따라 2주~한달 이상의 시간이 소요될 수 있습니다.


1. 그누보드5 또는 일반 PHP에 적용하기

1-1. 그누보드5 / seo_head.php 생성 해서 아래 내용을 저장
<?php
//////////////////////////////////////////////////////////////////////
////////////////////////////// SEO 시작 //////////////////////////////
//////////////////////////////////////////////////////////////////////
// 제작회사
$seo_Author = "";
$seo_Publisher  = "";

// 웹사이트 타이틀
$seo_head_title = "";

// 브라우저 테마 색상
$seo_theme_color = "#0a81a8";

// 주 언어 ex: kr
$seo_language = "kr";

// 로케일 ex: ko_KR , en_EN
$seo_locale = "ko_KR";

// 웹사이트 종류
$seo_type = "website";

// 대표 도메인
$secure_connection = !empty($_SERVER['HTTPS']); // https 확인
if ($secure_connection == true ) {
    $seo_domain_addr = "https://도메인";
} else {
    $seo_domain_addr = "http://". $_SERVER['SERVER_NAME'];
}

// 웹사이트 설명 (서술형 : 80자 이내)
$seo_descriptionS = "";

// 웹사이트 설명 (서술형 : 가능한 많이)
$seo_descriptionL = "";

// 키워드 (단어형 : 가능한 많이)  예) 프로그램개발,디자인
$seo_keywords = "";

$seo_image = $seo_domain_addr ."/img/logo_social.png"; // ex: /img/logo_social.png
$seo_image_width  = ""; // ex: 200
$seo_image_height = ""; // ex: 150

$seo_og_image = $seo_domain_addr ."/img/logo_social_og.png"; // ex: /img/logo_social_og.png
$seo_og_image_width  = ""; // ex: 1200
$seo_og_image_height = ""; // ex: 630

$seo_twitter_image = $seo_domain_addr ."/img/logo_social_twitter.png"; // ex: /img/logo_social_twitter.png
$seo_twitter_image_width  = ""; // ex: 800
$seo_twitter_image_height = ""; // ex: 418

// 페이스북 아이디
$seo_facebook = "";

// 트위터 아이디
$seo_twitter = "";

// Naver naver-site-verification 값
$naver_site_verification = "";
    
// Naver 아이디
$seo_naver = "";

// Naver 스토어팜 아이디 ( https://campaign.naver.com/storefarmguide/1/ )
$seo_naver_storefarm = "";

////////////////////////////////////////////////////////////////////
/////////////////////  이하 수정사항 없습니다. /////////////////////
////////////////////////////////////////////////////////////////////
// 제작회사
if ($config['cf_title']) $seo_Author = "{$config['cf_title']}";
if ($config['cf_title']) $seo_Publisher  = "{$config['cf_title']}";

// 웹사이트 타이틀
if ($config['cf_title']) $seo_head_title = "{$config['cf_title']}";

$gnu_seo_Publisher  = "{$seo_Author}";
$gnu_seo_Author     = ($wr_id) ? $write['wr_name'] : $seo_Publisher;
$gnu_seo_head_title = $g5_head_title;

if ($gnu_seo_Publisher) $seo_Publisher = $gnu_seo_Publisher;
if ($gnu_seo_Author) $seo_Author = $gnu_seo_Author;
if ($gnu_seo_head_title) $seo_head_title = $gnu_seo_head_title;

// 오늘 날짜
$seo_datetime = date("Y-m-d");

if ($bo_table) {
    if ($wr_id) {
        $seo_qry = sql_query(" select * from {$g5['write_prefix']}{$bo_table} where wr_id='{$wr_id}' ");
        $seo_row = sql_fetch_array($seo_qry);
        
        $seo_wr_datetime = $seo_row['wr_datetime'];
        if(strpos($seo_row['wr_option'], "secret") !== false) {
            $seo_descriptionL = $g5_head_title;
            $seo_descriptionS = $g5_head_title;
            $seo_keywords     = $g5_head_title;
        } else {
            $seo_description = str_replace('<br />', ' ', $seo_row['wr_content']); // &nbsp; 를 공백으로 교체하기
            $seo_description = str_replace('<br>', ' ', $seo_description); // &nbsp; 를 공백으로 교체하기
            $seo_description = str_replace('"', ' ', $seo_description); // " 를 공백으로 교체하기
            $seo_description = str_replace('&nbsp;', ' ', $seo_description); // &nbsp; 를 공백으로 교체하기
            $seo_description = preg_replace('/[\x00-\x1F\x7F]/', '', $seo_description); // 이상한 특수문자를 제어하는 코드 추가
            //$seo_keywords     = strip_tags($seo_description).", ".$seo_keywords;
            $seo_keywords = $seo_descriptionS .",". cut_str(strip_tags($seo_description),80);
            //$seo_descriptionL = strip_tags($seo_description) .", ". $seo_descriptionL;
            $seo_descriptionL = cut_str(strip_tags($seo_description),200);
            //$seo_descriptionS = cut_str(strip_tags($seo_description),80) .", ". $seo_descriptionS;
            $seo_descriptionS = cut_str(strip_tags($seo_description),80) .", ". $seo_descriptionS;
            $gnu_seo_datetime     = substr($seo_row['wr_datetime'],0,10);
            if ($seo_row['wr_last'] > $seo_row['wr_datetime']) {
                $gnu_seo_datetime = substr($seo_row['wr_last'],0,10);
            } else {
                $gnu_seo_datetime = substr($seo_row['wr_datetime'],0,10);
            }
        }
        
        // 썸네일 or 로고경로 (최소 200 x 200픽셀)
        include_once(G5_LIB_PATH.'/thumbnail.lib.php');
        $seo_thumb = get_list_thumbnail($bo_table, $wr_id, $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
        
        if($seo_thumb['src']) {
            $seo_image        = $seo_thumb['src'];
            $seo_image_width  = $board['bo_gallery_width'];
            $seo_image_height = $board['bo_gallery_height'];
        } /*else {
            if (preg_match("/<img.*src=\\\"(.*)\\\"/iUs", stripslashes($seo_row['wr_content']), $seo_tmp)) { // 에디터 이미지추출
                $seo_file = str_replace(G5_BBS_URL, "..",$seo_tmp[1]); // 파일명
                if (is_file($seo_file)) {
                    $seo_thumb = thumbnail($seo_file, $board['bo_gallery_width'], $board['bo_gallery_height'], 0, 1, 90, 0, "",  99, $noimg); // 에디터 썸네일
                    $seo_image        = $seo_thumb['src'];
                    $seo_image_width  = $board['bo_gallery_width'];
                    $seo_image_height = $board['bo_gallery_height'];
                }
            }
        }*/
    } else {
        if ($g5_head_title) {
            $seo_descriptionL = $g5_head_title.", ".$seo_descriptionL;
            $seo_descriptionS = $g5_head_title.", ".$seo_descriptionS;
            $seo_keywords = $g5_head_title.", ".$seo_keywords;
        }
    }
}

if ($gnu_seo_datetime) $seo_datetime = $gnu_seo_datetime;

// 사이트 언어
echo "<meta http-equiv=\"content-language\" content=\"{$seo_language}\">\r\n";

// 대표도메인 (선호 URL)
echo "<link rel=\"canonical\" href=\"{$seo_domain_addr}\">\r\n";

// 만든사람
echo "<meta name=\"Author\" contents=\"{$seo_Author}\">\r\n";
echo "<meta name=\"Publisher\" content=\"{$seo_Author}\">\r\n";
echo "<meta name=\"Other Agent\" content=\"{$seo_Author}\">\r\n";
echo "<meta name=\"copyright\" content=\"{$seo_Author}\">\r\n";

//  제작일 예) 2017-03-29
echo "<meta name=\"Author-Date\" content=\"{$seo_datetime}\" scheme=\"YYYY-MM-DD\">\r\n";
echo "<meta name=\"Date\" content=\"{$seo_datetime}\" scheme=\"YYYY-MM-DD\">\r\n";

// 사이트 제목
echo "<meta name=\"subject\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"title\" content=\"{$seo_head_title}\">\r\n";

// 설명
echo "<meta name=\"Distribution\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta name=\"description\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta name=\"Descript-xion\" content=\"{$seo_descriptionL}\">\r\n";

// 키워드
echo "<meta name=\"keywords\" content=\"{$seo_keywords}\">\r\n";

// 소셜 검색
echo "<meta itemprop=\"name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta itemprop=\"description\" content=\"{$seo_descriptionS}\">\r\n";
if ($seo_image) {
    echo "<meta itemprop=\"image\" content=\"{$seo_image}\">\r\n";
} elseif ($seo_og_imag) {
    echo "<meta itemprop=\"image\" content=\"{$seo_og_imag}\">\r\n";
}

// Open Graph: 네임스페이스가 지정된 meta 태그를 사용하여 메타데이터
echo "<meta property=\"og:locale\" content=\"{$seo_locale}\">\r\n"; // ko_KR
echo "<meta property=\"og:locale:alternate\" content=\"{$seo_locale}\">\r\n";
echo "<meta property=\"og:author\" content=\"{$seo_Author}\">\r\n";
echo "<meta property=\"og:type\" content=\"website\">\r\n";
echo "<meta property=\"og:site_name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta property=\"og:title\" id=\"ogtitle\" itemprop=\"name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta property=\"og:description\" id=\"ogdesc\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta property=\"og:url\" content=\"{$seo_domain_addr}{$_SERVER['REQUEST_URI']}\">\r\n";

if ($seo_image) {
    echo "<meta property=\"og:image\" id=\"ogimg\" content=\"{$seo_image}\">\r\n";
} elseif ($seo_og_imag) {
    echo "<meta property=\"og:image\" id=\"ogimg\" content=\"{$seo_og_image}\">\r\n";
    if ($seo_og_image_width) echo "<meta property=\"og:image:width\" content=\"{$seo_og_image_width}\">\r\n";
    if ($seo_og_image_height) echo "<meta property=\"og:image:height\" content=\"{$seo_og_image_height}\">\r\n";
}

if ($wr_id) echo "<meta property=\"og:updated_time\" content=\"".substr($seo_wr_datetime,0,10)."T".substr($seo_wr_datetime,11,18)."+09:00\">\r\n";

// iOS
echo "<meta name=\"apple-mobile-web-app-title\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"format-detection\" content=\"telephone=no\">\r\n";

// Android
if ($seo_theme_color) echo "<meta name=\"theme-color\" content=\"{$seo_theme_color}\">\r\n";

// twitter
if ($seo_twitter) echo "<meta name=\"twitter:site\" content=\"@{$seo_twitter}\">\r\n";
if ($seo_twitter) echo "<meta name=\"twitter:creator\" content=\"@{$seo_twitter}\">\r\n";
echo "<meta name=\"twitter:title\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"twitter:description\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta name=\"twitter:domain\" content=\"{$seo_domain_addr}\">\r\n";
echo "<meta name=\"twitter:url\" content=\"{$seo_domain_addr}{$_SERVER['REQUEST_URI']}\">\r\n";

if ($seo_image) {
    echo "<meta name=\"twitter:image\" content=\"{$seo_image}\">\r\n";
    if ($seo_image_width) echo "<meta name=\"twitter:image:width\" content=\"{$seo_image_width}\">\r\n";
    if ($seo_image_height) echo "<meta name=\"twitter:image:height\" content=\"{$seo_image_height}\">\r\n";
} elseif ($seo_twitter_image) {
    echo "<meta name=\"twitter:image\" content=\"{$seo_twitter_image}\">\r\n";
    if ($seo_twitter_image_width) echo "<meta name=\"twitter:image:width\" content=\"{$seo_twitter_image_width}\">\r\n";
    if ($seo_twitter_image_height) echo "<meta name=\"twitter:image:height\" content=\"{$seo_twitter_image_height}\">\r\n";
}

echo "<meta name=\"twitter:card\" content=\"summary\">\r\n"; // summary, photo, player , 신청: https://cards-dev.twitter.com/validator

// Naver
if ($naver_site_verification) echo "<meta name=\"naver-site-verification\" content=\"{$naver_site_verification}\">\r\n";

// 사이트 연관 채널
echo "<span itemscope=\"\" itemtype=\"http://schema.org/Organization\">\r\n";
echo "<link itemprop=\"url\" href=\"{$seo_domain_addr}\">\r\n";
if ($seo_facebook) echo "<a itemprop=\"sameAs\" href=\"https://www.facebook.com/{$seo_facebook}\"></a>\r\n";
if ($seo_twitter) echo "<a itemprop=\"sameAs\" href=\"https://twitter.com/{$seo_twitter}\"></a>\r\n";
if ($seo_naver) echo "<a itemprop=\"sameAs\" href=\"http://blog.naver.com/{$seo_naver}\"></a>\r\n";
if ($seo_naver_storefarm) echo "<a itemprop=\"sameAs\" href=\"http://storefarm.naver.com/{$seo_naver_storefarm}\"></a>\r\n";
echo "</span>\r\n";

// Windows용 타일 아이콘
if ($seo_theme_color) echo "<meta name=\"msapplication-TileColor\" content=\"{$seo_theme_color}\">\r\n";

echo "\r\n";

// 검색로봇 robots.txt
echo "<meta name=\"referrer\" content=\"no-referrer-when-downgrade\">\r\n";
echo "<meta name=\"robots\" content=\"all\">\r\n";
echo "\r\n";

////////////////////////////// SEO 끝 //////////////////////////////
////////////////////////////////////////////////////////////////////
?>


1-2. 그누보드5 / head.sub.php 의  <head></head> 사이에 아래 내용 추가

<?php include_once(G5_PATH."/seo_head.php"); ?>



2. 그누보드4 에 적용하기
<?php
//////////////////////////////////////////////////////////////////////
////////////////////////////// SEO 시작 //////////////////////////////
//////////////////////////////////////////////////////////////////////
// 제작회사
$seo_Author = "";
$seo_Publisher  = "";

// 웹사이트 타이틀
$seo_head_title = "";

// 브라우저 테마 색상
$seo_theme_color = "#0a81a8";

// 주 언어 ex: kr
$seo_language = "kr";

// 로케일 ex: ko_KR , en_EN
$seo_locale = "ko_KR";

// 웹사이트 종류
$seo_type = "website";

// 대표 도메인
$secure_connection = !empty($_SERVER['HTTPS']); // https 확인
if ($secure_connection == true ) {
    $seo_domain_addr="https://도메인";
} else {
    $seo_domain_addr="http://".$_SERVER['SERVER_NAME'];
}

// 웹사이트 설명 (서술형 : 80자 이내)
$seo_descriptionS = "";

// 웹사이트 설명 (서술형 : 가능한 많이)
$seo_descriptionL = "";

// 키워드 (단어형 : 가능한 많이)  예) 프로그램개발,디자인
$seo_keywords = "";

$seo_image = $g4['path']."/logo_social.png";
$seo_image_width  = "200";
$seo_image_height = "150";

$seo_og_image = $g4['path']."/img/logo_social_og.png";
$seo_og_image_width  = "1200";
$seo_og_image_height = "630";

$seo_twitter_image = $g4['path']."/img/logo_social_twitter.png";
$seo_twitter_image_width  = "800";
$seo_twitter_image_height = "418";

// 페이스북 아이디
$seo_facebook = "";

// 트위터 아이디
$seo_twitter = "";

// 네이버 naver-site-verification 값
$naver_site_verification = "";

////////////////////////////////////////////////////////////////////
/////////////////////  이하 수정사항 없습니다. /////////////////////
////////////////////////////////////////////////////////////////////
$gnu_seo_Publisher  = "{$config['cf_title']}";
$gnu_seo_Author     = ($wr_id) ? $write['wr_name'] : $seo_Publisher;
$gnu_seo_head_title = $g4['title'];

if ($gnu_seo_Publisher) $seo_Publisher = $gnu_seo_Publisher;
if ($gnu_seo_Author) $seo_Author = $gnu_seo_Author;
if ($gnu_seo_head_title) $seo_head_title = $gnu_seo_head_title;

// 오늘 날짜
$seo_datetime = date("Y-m-d");

if ($bo_table) {
    if ($wr_id) {
        $seo_qry = sql_query(" select * from {$g4['write_prefix']}{$bo_table} where wr_id='{$wr_id}' ");
        $seo_row = sql_fetch_array($seo_qry);
        
        $seo_wr_datetime = $seo_row['wr_datetime'];
        if(strpos($seo_row['wr_option'], "secret") !== false) {
            $seo_descriptionL = $g4['title'];
            $seo_descriptionS = $g4['title'];
            $seo_keywords     = $g4['title'];
        } else {
            $seo_description = str_replace('<br />', ' ', $seo_row['wr_content']); // &nbsp; 를 공백으로 교체하기
            $seo_description = str_replace('<br>', ' ', $seo_description); // &nbsp; 를 공백으로 교체하기

            $seo_description = str_replace('"', ' ', $seo_description); // " 를 공백으로 교체하기
            $seo_description = str_replace('&nbsp;', ' ', $seo_description); // &nbsp; 를 공백으로 교체하기
            $seo_description = preg_replace('/[\x00-\x1F\x7F]/', '', $seo_description); // 이상한 특수문자를 제어하는 코드 추가
            $seo_keywords     = strip_tags($seo_description).", ".$seo_keywords;
            $seo_descriptionL = strip_tags($seo_description).", ".$seo_descriptionL;
            $seo_descriptionS = cut_str(strip_tags($seo_description),80).", ".$seo_descriptionS;
            $gnu_seo_datetime     = substr($seo_row['wr_datetime'],0,10);
            if ($seo_row['wr_last'] > $seo_row['wr_datetime'])
            $gnu_seo_datetime     = substr($seo_row['wr_last'],0,10);
        }
        
        // 썸네일 or 로고경로 (최소 200 x 200픽셀)
        include_once($g4['path'].'/thumbnail.lib.php');
        $seo_thumb = get_list_thumbnail($bo_table, $wr_id, $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
        
        if($seo_thumb['src']) {
            $seo_image        = $seo_thumb['src'];
            $seo_image_width  = $board['bo_gallery_width'];
            $seo_image_height = $board['bo_gallery_height'];
        }
    } else {
        if ($g4['title']) {
            $seo_descriptionL = $g4['title'].", ".$seo_descriptionL;
            $seo_descriptionS = $g4['title'].", ".$seo_descriptionS;
            $seo_keywords = $g4['title'].", ".$seo_keywords;
        }
    }
}

if ($gnu_seo_datetime) $seo_datetime = $gnu_seo_datetime;

echo "\r\n";
// 사이트 언어
echo "<meta http-equiv=\"content-language\" content=\"{$seo_language}\">\r\n";

// 대표도메인
echo "<link rel=\"canonical\" href=\"{$seo_domain_addr}\">\r\n";

// 만든사람
echo "<meta name=\"Author\" contents=\"{$seo_Author}\">\r\n";
echo "<meta name=\"Publisher\" content=\"{$seo_Author}\">\r\n";
echo "<meta name=\"Other Agent\" content=\"{$seo_Author}\">\r\n";
echo "<meta name=\"copyright\" content=\"{$seo_Author}\">\r\n";

//  제작일 예) 2017-03-29
echo "<meta name=\"Author-Date\" content=\"{$seo_datetime}\" scheme=\"YYYY-MM-DD\">\r\n";
echo "<meta name=\"Date\" content=\"{$seo_datetime}\" scheme=\"YYYY-MM-DD\">\r\n";

// 사이트 제목
echo "<meta name=\"subject\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"title\" content=\"{$seo_head_title}\">\r\n";

// 설명
echo "<meta name=\"Distribution\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta name=\"Description\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta name=\"Descript-xion\" content=\"{$seo_descriptionL}\">\r\n";

// 키워드
echo "<meta name=\"keywords\" content=\"{$seo_keywords}\">\r\n";

// 소셜 검색
echo "<meta itemprop=\"name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta itemprop=\"description\" content=\"{$seo_descriptionS}\">\r\n";
if ($seo_image) {
    echo "<meta itemprop=\"image\" content=\"{$seo_image}\">\r\n";
} elseif ($seo_og_imag) {
    echo "<meta itemprop=\"image\" content=\"{$seo_og_imag}\">\r\n";
}

// Open Graph: 네임스페이스가 지정된 meta 태그를 사용하여 메타데이터
echo "<meta property=\"og:locale\" content=\"{$seo_locale}\">\r\n";
echo "<meta property=\"og:locale:alternate\" content=\"{$seo_locale}\">\r\n";
echo "<meta property=\"og:author\" content=\"{$seo_Author}\">\r\n";
echo "<meta property=\"og:type\" content=\"{$seo_type}\">\r\n";
echo "<meta property=\"og:site_name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta property=\"og:title\" id=\"ogtitle\" itemprop=\"name\" content=\"{$seo_head_title}\">\r\n";
echo "<meta property=\"og:description\" id=\"ogdesc\" content=\"{$seo_descriptionS}\">\r\n";
echo "<meta property=\"og:url\" content=\"{$seo_domain_addr}{$_SERVER['REQUEST_URI']}\">\r\n";

if ($seo_image) {
    echo "<meta property=\"og:image\" id=\"ogimg\" content=\"{$seo_image}\">\r\n";
} elseif ($seo_og_imag) {
    echo "<meta property=\"og:image\" id=\"ogimg\" content=\"{$seo_og_image}\">\r\n";
    if ($seo_og_image_width) echo "<meta property=\"og:image:width\" content=\"{$seo_og_image_width}\">\r\n";
    if ($seo_og_image_height) echo "<meta property=\"og:image:height\" content=\"{$seo_og_image_height}\">\r\n";
}

if ($wr_id) { echo "<meta property=\"og:updated_time\" content=\"".substr($seo_wr_datetime,0,10)."T".substr($seo_wr_datetime,11,18)."+09:00\">\r\n"; }

// iOS
echo "<meta name=\"apple-mobile-web-app-title\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"format-detection\" content=\"telephone=no\">\r\n";

// Android
echo "<meta name=\"theme-color\" content=\"{$seo_theme_color}\">\r\n";

// twitter
if ($seo_twitter) {
echo "<meta name=\"twitter:site\" content=\"@{$seo_twitter}\">\r\n";
echo "<meta name=\"twitter:creator\" content=\"@{$seo_twitter}\">\r\n";
}
echo "<meta name=\"twitter:title\" content=\"{$seo_head_title}\">\r\n";
echo "<meta name=\"twitter:description\" content=\"{$seo_descriptionS}\"\r\n";
echo "<meta name=\"twitter:url\" content=\"{$seo_domain_addr}{$_SERVER['REQUEST_URI']}\">\r\n";

if ($seo_image) {
    echo "<meta name=\"twitter:image\" content=\"{$seo_image}\">\r\n";
    if ($seo_image_width) echo "<meta name=\"twitter:image:width\" content=\"{$seo_image_width}\">\r\n";
    if ($seo_image_height) echo "<meta name=\"twitter:image:height\" content=\"{$seo_image_height}\">\r\n";
} elseif ($seo_twitter_image) {
    echo "<meta name=\"twitter:image\" content=\"{$seo_twitter_image}\">\r\n";
    if ($seo_twitter_image_width) echo "<meta name=\"twitter:image:width\" content=\"{$seo_twitter_image_width}\">\r\n";
    if ($seo_twitter_image_height) echo "<meta name=\"twitter:image:height\" content=\"{$seo_twitter_image_height}\">\r\n";
}

echo "<meta name=\"twitter:card\" content=\"summary\">\r\n"; // summary, photo, player , 신청: https://cards-dev.twitter.com/validator
echo "<meta name=\"twitter:domain\" content=\"{$_SERVER['HTTPS']}\">\r\n";

// 네이버
if ($naver_site_verification) { echo "<meta name=\"naver-site-verification\" content=\"{$naver_site_verification}\">"; }

echo "\r\n";

echo "<meta name=\"referrer\" content=\"no-referrer-when-downgrade\">\r\n";
echo "<meta name=\"robots\" content=\"all\">\r\n";

echo "\r\n";
////////////////////////////////////////////////////////////////////
////////////////////////////// SEO 끝 //////////////////////////////
////////////////////////////////////////////////////////////////////
?>



3. ASP 에 적용하기
<% 
dim seo_Author, seo_head_title, seo_domain_addr
dim seo_datetime, seo_descriptionS, seo_descriptionL
dim seo_image, seo_image_width, seo_image_height, seo_keywords
dim seo_og_image, seo_og_image_width, seo_og_image_height
dim seo_twitter_image, seo_twitter_image_width, seo_twitter_image_height
dim seo_theme_color
dim naver_site_verification, seo_facebook, seo_twitter

' 제작회사
seo_Author = "" 

' 웹사이트 타이틀
seo_head_title = ""

' 대표 도메인
if Request.ServerVariables("HTTPS")="on" Then  ' https 일때
    'seo_domain_addr= "https://도메인"  ' ssl 등록된 도메인을 입력
else ' http 일때
    seo_domain_addr= "http://" & Request.ServerVariables("http_host")
end if

' 웹사이트 설명 (80자 이내)
seo_descriptionS = ""

' 키워드 (가능한 많이)
seo_descriptionL = ""

' 키워드 (가능한 많이)  예) 프로그램개발,디자인
seo_keywords = ""

seo_image = "/img/logo_social.png"
seo_image_width  = "200"
seo_image_height = "150"

seo_og_image = "/img/logo_social_og.png"
seo_og_image_width  = "1200";
seo_og_image_height = "630";

seo_twitter_image = "/img/logo_social_twitter.png"
seo_twitter_image_width  = "800"
seo_twitter_image_height = "418"

' 브라우저 테마 색상
seo_theme_color = "#0a81a8"

' 웹페이지 생성날짜
seo_datetime = ""

' 페이스북아이디
seo_facebook = ""

' 트위터아이디
seo_twitter = ""

' 네이버 naver-site-verification 값
naver_site_verification = ""

'////////////////////////////////////////////////////////////////////
'/////////////////////  이하 수정사항 없습니다. /////////////////////
'////////////////////////////////////////////////////////////////////
if seo_datetime="" then
    seo_datetime = left(date(),4) &"-"& mid(date(),6,2) &"-"& right(date(),2)
end if

seo_descriptionL = seo_head_title & ", " & seo_descriptionL
seo_descriptionS = seo_head_title & ", " & seo_descriptionS
seo_keywords = seo_head_title & ", " & seo_keywords
%>

<meta name="referrer" content="no-referrer-when-downgrade">
<meta name="robots" content="all">

<meta http-equiv="content-language" content="kr"><% '  웹사이트 언어. 예) kr %>
<link rel="canonical" href="<% response.write seo_domain_addr %>"><% ' 대표도메인 %>

<% ' 제작일. 예) 2017-03-29 %>
<meta name="Author-Date" content="<% response.write seo_datetime %>" scheme="YYYY-MM-DD">
<meta name="Date" content="<% response.write seo_datetime %>" scheme="YYYY-MM-DD">

<meta name="Generator" content=""><% ' 생성프로그램(에디터). 예) 메모장 %>
<meta name="Author" contents="<% response.write seo_Author %>"><% ' 만든사람 이름. 예) 해피정닷컴 %>
<meta name="Publisher" content="<% response.write seo_Author %>"><% ' 만든단체나회사 이름 %>
<meta name="Other Agent" content="<% response.write seo_Author %>"><% ' 배포자 %>
<meta name="copyright" content="<% response.write seo_Author %>"><% ' 저작권  예) 해피정닷컴 %>

<% ' 웹페이지 제목   %>
<meta name="subject" content="<% response.write seo_head_title %>">
<meta name="title" content="<% response.write seo_head_title %>">

<% ' 설명 %>
<meta name="description" content="<% response.write seo_descriptionS %>">
<meta name="Distribution" content="<% response.write seo_descriptionS %>">
<meta name="Descript-xion" content="<% response.write seo_descriptionL %>">

<% ' 키워드 %>
<meta name="keywords" content="<% response.write seo_keywords %>">

<% ' 소셜  %>
<meta itemprop="name" content="<% response.write seo_head_title %>">
<meta itemprop="description" content="<% response.write seo_descriptionL %>">
<meta itemprop="image" content="<% response.write seo_domain_addr & seo_image %>">

<% ' Open Graph: 네임스페이스가 지정된 meta 태그를 사용하여 메타데이터 %>
<meta property="og:locale" content="ko_KR"><% '  웹사이트 언어. 예) ko_KR  %>
<meta property="og:locale:alternate" content="ko_KR">
<meta property="og:locale:alternate" content="en_EN">
<meta property="og:author" content="<%
if seo_facebook="" then
    response.write seo_Author
else
    response.write "https://www.facebook.com/" & seo_facebook &"/"
end if %>"><% ' 만든사람 이름. 예) 해피정닷컴  %>
<meta property="og:type" content="website"><% '  분류.  ex) website, article, place, product, event, ...  %>
<meta property="og:site_name" content="<% response.write seo_head_title %>">
<meta property="og:title" id="ogtitle" content="<% response.write seo_head_title %>">
<meta property="og:description" id="ogdesc" content ="<% response.write seo_descriptionS %>">
<meta property="og:url" content="<% response.write seo_domain_addr & request.servervariables("http_url") %>">
<meta property="og:image" id="ogimg" content="<% response.write seo_domain_addr & seo_image %>">
<meta property="og:image:width" content="<% response.write seo_og_image_width %>">
<meta property="og:image:height" content="<% response.write seo_og_image_height %>">

<% ' Twitter %>
<% if seo_twitter<>"" then %>
<meta name="twitter:site" content="@<% response.write seo_twitter %>">
<meta name="twitter:creator" content="@<% response.write seo_twitter %>">
<% end if %>
<meta name="twitter:title" content="<% response.write seo_head_title %>">
<meta name="twitter:description" content="<% response.write seo_descriptionS %>">
<meta name="twitter:domain" content="<% response.write response.ServerVariables("http_host") %>">
<meta name="twitter:url" content="<% response.write seo_domain_addr & request.servervariables("http_url") %>">
<meta name="twitter:site" content="<% response.write seo_domain_addr %>">
<meta name="twitter:image" content="<% response.write seo_domain_addr & seo_twitter_image %>">
<meta name="twitter:image:width" content="<% response.write seo_twitter_image_width %>">
<meta name="twitter:image:height" content="<% response.write seo_twitter_image_width %>">
<meta name="twitter:card" content="summary"><% ' summary, photo, player , 신청: https://cards-dev.twitter.com/validator  %>

<% ' iOS %>
<meta name="apple-mobile-web-app-title" content="<% response.write seo_head_title %>">
<meta name="format-detection" content="telephone=no">

<% ' Android %>
<meta name="theme-color" content="<% response.write seo_theme_color %>">

<% ' Naver %>
<% if naver_site_verification <> "" then %>
<meta name="naver-site-verification" content="<% response.write naver_site_verification %>">
<% end if %>


4. 로봇대응
<!--  선택 - robot 대응  -->
<meta name="Robots" content="ALL">  <!-- 모든 문서 허용 -->
<meta name="Robots" content="index,follow">  <!--  이 문서도 긁어가고 링크된 문서도 긁어감  -->
<meta name="Robots" content="noindex,follow"> <!--  이 문서는 긁어가지 말고 링크된 문서만 긁어감  -->
<meta name="Robots" content="index,nofollow"> <!--  이 문서는 긁어가되, 링크는 무시  -->
<meta name="Robots" content="noindex,nofollow"> <!--  이 문서도 긁지 않고, 링크도 무시함  -->



그외 메타테그(Meta tag) 및 기타 테그  https://www.happyjung.com/lecture/45


참고자료
http://blog-pleur.tistory.com/21
http://blog.munilive.com/펌-메타태그meta-tag-속성정리-및-사용-방법/
https://blog.outsider.ne.kr/922

댓글목록

profile_image

보안서버님의 댓글

보안서버 이름으로 검색 작성일

보안서버... 즉 https 를 사용하지 않는 겨웅에는 어떻게 해야하나요?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

https , http 상관없이 작동합니다

profile_image

예뜨락님의 댓글

예뜨락 이름으로 검색 작성일

검색하다가 들어왔습니다 정리가 잘되어 있네요
감사합니다 덕분에 도움이 되었습니다 : )

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

도움되셨다니 기쁩니다. 감사합니다

profile_image

주현님의 댓글

no_profile 주현 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

질문입니다.
영카트 사용중인데요 관리자에서 매타태그란에 코드를 넣었는데
무시하고 php 파일을 만든후 위내용을 php에 넣고 루트 디렉토리에 올려도 될까요 ?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

관리자에서 넣는것보다는 제가 만든 방식으로 사용하는것이 좋습니다
루트 = 영카트 최상단 에 업로드 하면 됩니다

profile_image

주현님의 댓글의 댓글

no_profile 주현 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

아 그렇군요 관리자 매타태그란은 생각보다 구글 노출에 거의 도움이 안되더군요
감사합니다.
위내용을 루트디렉토리에 업로드 한다고 했을때
그럼 관리자 메타태그란 내용은 모두 삭제하는게 좋을까요 ?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

관리자 넣은것은 삭제하셔도 좋습니다

profile_image

주현님의 댓글

no_profile 주현 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

위내용에 robots 관련내용도 들어가 있는데요 그럼 루트 디렉토리에 올라간 robots.txt 삭제해도 되나요 ?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

루트 디렉토리의 robots.txt 는 유지하는것이 좋습니다
거기에 sitemap 경로 등을 적어놓는 용도로도 사용됩니다

profile_image

ass0204님의 댓글

ass0204 이름으로 검색 작성일
profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

문제를 확인할 수 없습니다
적용된 홈페이지 url 이 있으면 meta 노출된 상황을 살펴볼텐데,
제공된 정보가 제한적이라서 답변을 드릴수 없습니다

profile_image

ass0204님의 댓글의 댓글

ass0204 이름으로 검색 작성일
profile_image

푸른산타님의 댓글

푸른산타 이름으로 검색 작성일

관리자님
그누보드5 / seo_head.php 파일 193라인 echoecho 중복이네요 수정해주세요^^
if ($seo_og_image_height) echoecho "<meta property=\"og:image:height\" content=\"{$seo_og_image_height}\">\r\n";

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

내용 수정했습니다. 감사합니다

profile_image

max872님의 댓글

max872 이름으로 검색 작성일

도메인 넣는곳이 1군데 인지 2군데 인지 몰라 질문드립니다.

// 대표 도메인
$secure_connection = !empty($_SERVER['HTTPS']); // https 확인
if ($secure_connection == true ) {
    $seo_domain_addr = "https://도메인";  --> 여기는 넣었습니다.
} else {
    $seo_domain_addr = "http://". $_SERVER['SERVER_NAME'];  ---> 여기에도 도메인 넣어야 하나요 ?
                                    예) "http://daum.net"/ $_SERVER ~~    --> 이렇게 도메인 넣을까요 ?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

$seo_domain_addr = "https://도메인";  <<== 여기에만 넣습니다

profile_image

배워야겠다님의 댓글

no_profile 배워야겠다 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

안녕하세요 지식이 짧아 문의 남깁니다..ㅠㅠ

웹사이트 타이틀
 // 웹사이트 타이틀
$seo_head_title = "";  이부분을 추가해도 홈페이지 환경설정의 제목으로 자동으로 바뀌게 되어있는데

혹시 SEO상 웹사이트 타이틀을 기본환경설정과 다르게 설정할 수 있을까요?
쇼핑몰 메인화면 상단에 로고처럼 뜨는 쇼핑몰이름이 기본환경설정에 홈페이지 제목이 그대로 떠서 바꿀수가 없어서요...ㅠ

기본환경설정의 홈페이지제목은 그대로 두고 구글이나 다른 곳에서 검색될때 제목만 "홈페이지이름-그외 설명추가" 이런식으로
바꾸고 싶습니다 ㅠㅠ

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

강좌를 적용하면 게시글마나, 상품마다 다른 seo 생성됩니다.

profile_image

완전좋은내용님의 댓글

완전좋은내용 이름으로 검색 작성일

안녕하세요 정말 좋은 자료 잘 봤습니다 감사합니다.
한가지 궁금한 점은, 각 게시글 마다 제목과 내용에 위 SEO가 적용되도록 하려면 어떻게 해야 할까요?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

강의내용이 게시판마다 그리고 게시글마다 다른 seo 정보를 생성합니다.

profile_image

그냥뛰어님의 댓글

그냥뛰어 이름으로 검색 작성일

안녕하세요. 초보이며
그누보드 5버전 사용중입니다.

1-1항목
// Naver naver-site-verification 값
$naver_site_verification = "";
이부분은 어떤값을 넣어야 할까요

3. ASP 에 적용하기
이부분은  어디에 어떤 문서를 수정, 반영하면 되는지 알려주시면 감사하겠습니다.

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

1. 네이버 설정 항목인데, 굳이 넣지 않아도 문제는 없습니다.
3. 홈페이지 개발 언어가 ASP 일때만 사용합니다.

profile_image

송님님의 댓글

no_profile 송님 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

사이트 적용후
페이지를 클릭시에 연결할수 없다고 나옵니다.
어디를 살펴보면 좋을까요?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

적용한 내용을 다시 확인해보세요

profile_image

송님님의 댓글의 댓글

no_profile 송님 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

혹시 연락 가능한 sns 계정이 있으실까요?번거롭게 해드려 죄송합니다

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

작업의뢰 하시면 비용이 발생합니다.
위 내용을 찬찬히 살펴보시면서 확인해보시고,
의뢰를 희망하시면 mail@happyjung.com 으로 메일주시면 비용 견적 보내드리겠습니다.

profile_image

송님님의 댓글의 댓글

no_profile 송님 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

seo_head의 업로드 경로는 최상위 루트가 되는지요?
head_sub.php와 같은경로에 업로드 하였는데 맞을까요?

profile_image

송님님의 댓글의 댓글

no_profile 송님 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 작성일

메일 드렸습니다

profile_image

메타님의 댓글

메타 이름으로 검색 작성일

보다 궁금한게 있는데요
페이스북이나 트위터 같은 메타의 경우 계정정보없이 이렇게 메타태그만 정의해두면
페이스북이나 트위터에서 검색이 되나요?
보통sns는 검색하면 각 계정들이 올린 게시물들이 검색이 되는데
어떻게 검색이 되는건지 이해가 잘 되지 않네요

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

sns 에서 운영하는 bot 이 색인을 해갈때 확인해갑니다.

profile_image

그냥뛰님의 댓글

그냥뛰 이름으로 검색 작성일
profile_image

그냥뛰님의 댓글의 댓글

그냥뛰 이름으로 검색 작성일

한 두달 삽질하다가
적용후 모든 게시물의 썸네일이 작게 보이는 현상때문에
일단 원복후 나중에 한번 다시 적용해 볼게요.
감사합니다.

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

게시판 (갤러리)의 게시글 목록페이지 또는 게시글 본문에 썸네일은 seo 와 관계가 없습니다.
seo 에서의 썸네일은 카카오톡, 트위터, 페이스북 등에서 연계될때 작동합니다.

profile_image

그냥뛰님의 댓글의 댓글

그냥뛰 이름으로 검색 작성일

제가 적용을 잘못한 탓인지는 모르겠지만
적용 전후의 썸내일 변화(크기변화)를 잡고 싶은데 코딩을 잘 몰라서 삽질만 하고 있습니다.
도움좀 구할수 있을가요?

profile_image

관리자1님의 댓글의 댓글

관리자1 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

$seo_  로 작성되어 게시판 등의 어떤것과 중복되지 않습니다.
의뢰를 하시면 점검은 가능하며, 기본작업비용은 5만원이고, 성황분석후 추가비용이 청구될 수 있습니다.
작업의뢰 희망하시면 mail@happyjung.com 으로 정보를 보내주세요

profile_image

김성진님의 댓글

김성진 이름으로 검색 작성일

<?php include_once(G5_PATH."/seo_head.php"); ?>
head.sub.php 적용하니..
파비콘이 적용이 안됩니다.
충돌이 일어나는 것 같아요..


Total 2,633건 1 페이지
  • RSS
기술자료 목록
2633
MySQL   324  2024-03-29 14:14 ~ 2024-03-29 14:14  
2632
그누보드   639  2024-02-23 18:40 ~ 2024-02-24 06:13  
2631
JavaScript   730  2024-02-16 18:50 ~ 2024-02-16 20:37  
2630
Java   661  2024-02-06 16:49  
2629
PHP   750  2024-02-06 16:42  
2628
호스팅   697  2024-01-29 12:54  
2627
PHP   825  2024-01-26 11:04 ~ 2024-01-26 11:13  
2626
MySQL   1045  2024-01-08 17:37 ~ 2024-03-14 16:00  
2625
SQL   1028  2024-01-08 12:36  
2624
영카트   1192  2024-01-04 14:57  
2623
일반   2073  2023-12-15 18:33  
2622
Android   1650  2023-11-30 18:48 ~ 2023-11-30 19:41  
2621
전자결제   2988  2023-11-23 19:53  
2620
PHP   2205  2023-11-20 10:56 ~ 2023-11-20 11:14  
2619
Linux   1939  2023-11-09 19:55  
2618
그누보드   1909  2023-11-06 20:38  
2617
Linux   1880  2023-11-01 21:41 ~ 2023-11-02 10:30  
2616
영카트   1941  2023-10-07 23:31  
2615
SNS   2916  2023-09-24 17:56  
2614
ClassicASP   2643  2023-09-14 08:38  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: 서울센터 (08393) 서울시 구로구 디지털로32가길 16 파트너스타워2차 1206-280호
        대전센터 (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 지원1동 205호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 2014-서울구로-0074 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.