워드프레스 구글색인 하려고 실시간테스트 누르면 개선사항과 환경 부분에 심각하기 않은 문제라고 노란색 불 들어오면서 이렇게 나오는 경우가 있다. 이게 뭔지 해결은 가능한지 알아보았다.
wpDiscuz 평점+댓글 플러그인 사용하다가 평점 수정 가능한 플러그인으로 교체하고 댓글창을 워드프레스 GP프리미엄 순정으로 돌렸는데, 갑자기 이런 현상이 생겼다.
그리고 낑낑대면서 해결하다보니 이번에는 아예 빨간불 들어오는 심각한 오류 항목으로 ‘datePublished’ 입력란의 날짜/시간이 ISO 8601 형식에 맞지 않습니다. 라는 메세지까지 뜨기 시작했다.
퍼플렉시티와 클로드에 질문해서 해결을 위한 코드를 받았는데
// Schema.org 날짜 형식 수정
function fix_date_schema($data) {
if (isset($data['datePublished'])) {
$data['datePublished'] = get_the_date('c');
}
if (isset($data['dateModified'])) {
$data['dateModified'] = get_the_modified_date('c');
}
return $data;
}
add_filter('wpseo_schema_article', 'fix_date_schema');
// 작성자 URL 수정
function fix_author_url($comment_author_link, $comment_author, $comment_id) {
$author_url = get_comment_author_url($comment_id);
if (!empty($author_url)) {
$comment_author_link = str_replace('<a', '<a itemprop="url"', $comment_author_link);
}
return $comment_author_link;
}
add_filter('get_comment_author_link', 'fix_author_url', 10, 3);
function.php에 넣으라고 시키는 대로 해보았지만 해결되지 않는다. 애초에 저 코드가 먼 소리인지도 모르겠고.
GP프리미엄 테마의 최근 버전에서 이런 현상이 있는건지, 워드프레스 순정 댓글창이 현재 구글색인시 이런 오류가 뜨는건지 모르겠다.
자몽지점이라는 사이트의 후기를 보니 GP프리미엄 테마와 연관이 있고, 해결방법은 없으며, 굳이 해결할 필요 없이 무시하면 된다는 결론이었다.
그런데 왠지 냅두면 찜찜한 것도 있어서 (노란불이면 상관없다지만 중간에 빨간불 문제도 뜨기도 했었으니까 – 이건 내가 css 건드리면서 생겼을 수도 있지만) 별점 플러그인은 feedbackWP로 놔두고 wpDiscuz에서는 평점 부분은 disable 처리하고 댓글창 부분만 활성화해서 놔두었다.
그리고 구글 리치 검색결과 테스트에서 돌려보니 오류가 이제 뜨지 않는다. 일단은 이 상태로 사용을 해야겠다.
그리고 워드프레스 순정 댓글창 디자인 수정을 위해 만들었던 CSS는 사용자 정의하기에서 빼버리고 여기에만 백업용으로 남겨놓는다. 언젠가 순정으로 다시 돌아갈 수도 있으니.
/*댓글*/
/* 댓글 제목 숨기기 */
.comments-title {
display: none;
}
/* 작성자 정보 컨테이너 */
.comment-author-info {
display: flex;
align-items: center;
gap: 1em;
position: relative;
padding-left: 0; /* 기본 패딩 제거 */
}
/* 대댓글 작성자 정보 조정 */
.children .comment-author-info {
padding-left: 1.5em;
}
.children .comment-author-info:before {
content: "└";
position: absolute;
padding-left: 1em; /* 기호 위치를 더 오른쪽으로 조정 */
color: #830b0b;
}
/* 작성자와 시간 링크 스타일 제거 */
.comment-author a,
.comment-metadata a {
text-decoration: none;
color: inherit;
pointer-events: none;
cursor: default;
}
/* 모든 여백 초기화 */
ul.children, .comment .children {
list-style: none;
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
}
/* children 내부의 댓글은 테두리 제거 */
.children li.comment {
border: none !important;
}
/* 개별 댓글 */
.comment-body {
padding: 1.5em;
background: #fff;
margin: 0;
border: none;
}
/* 전체 댓글 그룹에 대한 테두리 설정 */
li.comment {
border: none;
margin: 0;
padding: 0;
}
/* 첫 번째 댓글 상단 테두리 */
.comment-list > li.comment:first-child {
border-top: 1px solid rgba(0, 0, 0, .05) !important;
}
/* 모든 댓글의 좌우 테두리 */
.comment-list > li.comment {
border-left: 1px solid rgba(0, 0, 0, .05);
border-right: 1px solid rgba(0, 0, 0, .05);
border-bottom: 1px solid rgba(0, 0, 0, .05);
}
/* 댓글 내용 */
.comment-content {
line-height: 1.6;
color: #444;
margin-top: 1em;
padding: 0;
border: none !important;
}
.children .comment-author-info:before {
content: "└\00a0";
position: absolute;
left: -1em;
color: #830b0b;
}
/* 댓글 제출 버튼 */
#submit {
background-color: #830b0b;
color: white;
padding: 0.5em 1em;
border: none;
border-radius: 4px;
cursor: pointer;
}
#submit:hover {
background-color: #6a0909;
}