SNS를 통한 소통은 브랜드 마케팅의 핵심입니다.
하지만 인스타그램 댓글, 유튜브 댓글, DM 문의를 일일이 수집하고 응답하는 것은 시간과 리소스가 많이 소모되는 반복 업무입니다.
이제는 워드프레스를 중심으로 댓글/DM 수집을 자동화하고, CRM 및 마케팅 시스템과 연계해 활용할 수 있습니다.
이 글에서는
✅ 인스타그램 & 유튜브 API 연동
✅ 워드프레스 내 데이터 수집/저장 구조
✅ 자동화 기능 구현
까지 실전 위주로 정리해드립니다.
✅ 1. 시스템 구조 한눈에 보기
[Instagram/YouTube 댓글 or DM]
↓ (API 호출)
[워드프레스 functions.php or REST API]
↓
[Custom Post Type or DB에 저장]
↓
[대시보드 출력 / 알림 전송 / 자동 응답]
이 구조는 반복적인 수작업 없이도
SNS 반응 기반의 마케팅 자동화를 가능하게 합니다.
✅ 2. 인스타그램 댓글 & DM 수집 – Graph API 연동
전제 조건
- 인스타그램 비즈니스 계정
- 페이스북 페이지 연동
- Facebook Developers 앱 등록
주요 API
/media: 게시물 목록/comments: 각 게시물의 댓글/conversations: DM (베타 기능)
실전 코드 예제 (functions.php)
function fetch_instagram_comments() {
$access_token = 'EAAB...'; // Access Token
$ig_id = '1784...'; // Instagram Business ID
$media_url = "https://graph.facebook.com/v17.0/{$ig_id}/media?fields=id,caption&access_token={$access_token}";
$response = wp_remote_get($media_url);
$data = json_decode(wp_remote_retrieve_body($response), true);
foreach ($data['data'] as $media) {
$media_id = $media['id'];
$comments_url = "https://graph.facebook.com/v17.0/{$media_id}/comments?access_token={$access_token}";
$comments_res = wp_remote_get($comments_url);
$comments_data = json_decode(wp_remote_retrieve_body($comments_res), true);
foreach ($comments_data['data'] as $comment) {
wp_insert_post([
'post_type' => 'sns_feedback',
'post_title' => $comment['from']['username'],
'post_content' => $comment['text'],
'post_status' => 'publish',
'meta_input' => [
'sns' => 'instagram',
'comment_id' => $comment['id'],
]
]);
}
}
}
💡 참고: DM 수집은 별도 승인 및 Instagram Messaging API 연동 필요
✅ 3. 유튜브 댓글 수집 – YouTube Data API v3 활용
준비 사항
- Google Cloud Console에서 API 키 발급
- 유튜브 채널 또는 영상 ID 확보
API 엔드포인트
commentThreads→ 댓글 리스트comments→ 대댓글 수집
워드프레스 코드 예제
function fetch_youtube_comments($video_id, $api_key) {
$url = "https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId={$video_id}&maxResults=50&key={$api_key}";
$response = wp_remote_get($url);
$data = json_decode(wp_remote_retrieve_body($response), true);
foreach ($data['items'] as $item) {
$c = $item['snippet']['topLevelComment']['snippet'];
wp_insert_post([
'post_type' => 'sns_feedback',
'post_title' => $c['authorDisplayName'],
'post_content' => $c['textDisplay'],
'post_status' => 'publish',
'meta_input' => [
'sns' => 'youtube',
'comment_id' => $item['id'],
]
]);
}
}
✅ 4. 워드프레스 내부 구조 설정
커스텀 포스트 타입 생성 (sns_feedback)
function sns_feedback_post_type() {
register_post_type('sns_feedback', [
'labels' => ['name' => 'SNS 피드백'],
'public' => true,
'has_archive' => true,
'supports' => ['title', 'editor', 'custom-fields'],
]);
}
add_action('init', 'sns_feedback_post_type');
✅ 댓글/DM을 이 포스트 타입에 저장하면
관리자 화면에서 쉽게 관리 + 통계 활용 가능
✅ 5. 자동화 기능 연계
자동 알림 (예: 메일, 알림톡)
wp_mail('your@email.com', '새 SNS 댓글 수신', '댓글이 등록되었습니다.');
필터링 조건 예시
if (strpos($comment['text'], '쿠폰') !== false) {
// 쿠폰 자동 응답 또는 DB 플래그 설정
}
✅ 6. 대시보드에 댓글/DM 출력
$args = ['post_type' => 'sns_feedback', 'posts_per_page' => 10];
$query = new WP_Query($args);
while ($query->have_posts()): $query->the_post();
echo '<p><strong>' . get_the_title() . '</strong>: ' . get_the_content() . '</p>';
endwhile;
플러그인 활용 옵션
| 플러그인 | 역할 |
|---|---|
| WP Webhooks | 외부 API 데이터 자동 수신 |
| Advanced Custom Fields (ACF) | 필드 관리 |
| TablePress / WP DataTables | 표 형태 출력 |
| WP Mail SMTP | 메일 전송 안정화 |
| FluentCRM / MailPoet | 자동 마케팅 연계 |
✅ 7. 자동화 확장: Zapier, Make (Integromat)
| 플랫폼 | 기능 |
|---|---|
| Zapier | 유튜브 댓글 발생 → 워드프레스 자동 등록 |
| Make (Make.com) | 인스타 게시글/댓글 수집 → DB 삽입, 슬랙 알림, Google Sheet 저장 등 |
✅ 활용 사례 예시
| 유형 | 활용 방식 |
|---|---|
| 이벤트 참여 수집 | 댓글 키워드 포함자만 자동 등록 |
| DM 문의 | 메시지 내용 저장 → 관리자 알림 |
| 유튜브 리뷰 댓글 | 자동 수집 후 키워드 분석 |
| 상담 예약 | DM → 예약 폼 링크 자동 응답 |
✅ 마무리 요약
| 항목 | 내용 |
|---|---|
| 인스타 수집 | Graph API + access_token 필요 |
| 유튜브 수집 | YouTube API + video ID 기반 |
| 워드프레스 저장 | 커스텀 포스트 타입 or 별도 테이블 |
| 자동화 확장 | 알림톡, 메일, CRM 연계 가능 |
| 비개발자 대안 | Zapier, Make 사용 가능 |
🏁 결론
SNS 마케팅은 빠르게 반응하고, 정확히 수집하며, 자동으로 응답해야 경쟁력이 생깁니다.
워드프레스는 이러한 SNS 데이터 자동화를 구현할 수 있는 유연한 플랫폼입니다.
인스타그램, 유튜브 등 외부 플랫폼의 댓글과 DM을
자사몰, 블로그, 회원 시스템과 직접 연결하고 싶다면,
지금 바로 자동화 시스템을 구축해 보세요.
추천 키워드 (SEO):
워드프레스 인스타그램 API 연동 / 유튜브 댓글 수집 자동화 / 워드프레스 SNS 자동화 / 인스타 DM 워드프레스 저장 / 워드프레스 마케팅 자동 응답 / functions.php API 연동
댓글