워드프레스 카테고리 ID 검색하기

워드프레스에서 카테고리 ID를 추출해야 하는 때가 있다.고유주소를 변경해서 이러쿵 저러쿵 해서 알아내는 방법도 있지만 간단하게 DB에 접속해서 쿼리로 알아내면 편하더라 SELECT t.term_id, t.name, t.slug, tt.parent, tt.count FROM wp_terms t INNER JOIN wp_term_taxonomy tt ON t.term_id = tt.term_id WHERE tt.taxonomy = ‘category’ ORDER BY tt.parent ASC, t.name ASC; 또는 아래와 같이 하면 더 자세하게 알수 있다. […]

워드프레스를 다른 사이트로 이전시 첨부된 사진의 경로가 어긋나는 경우가 있다.

예를 들어 A 사이트에 있었던 사진의 경로가 https://a.com/wp-content/uploads/2024/04/1.jpg 였는데 이전후에 실제로 있어야 할 경로는 https://b.com/wp-content/uploads/2024/04/1.jpg 가 되어야 하는 경우가 있다. 이런 경우에는 wp 명령어를 이용해 DB에서 일괄 수정한다. curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.pharchmod +x wp-cli.pharsudo mv wp-cli.phar /usr/local/bin/wp wp –info 실행은 워드프레스가 설치된 폴더에서 한다. root@ilikeafrica:/var/www/ilikeafrica# wp search-replace ‘https://ilikeafrica.com’ ‘https://ilikeafrica.com’ –all-tables –allow-root /var/www/ilikeafrica에 워드프레스가 설치되어 있고, 기존 DB에 있었던 https://ilikeafrica.com 이란 항목을 모두 https://ilikeafrica.com 로 […]

wordpress에 redis 연동시키기 image

wordpress에 redis 연동시키기

Status: Not connected Client: predis Drop-in: Valid Disabled: No Ping: Connection Exception: ERR unknown command ‘SENTINEL’, with args beginning with: ‘slaves’ ‘마스터 서버이름’ (Predis\Response\ServerException) Errors: [ “ERR unknown command ‘SENTINEL’, with args beginning with: ‘slaves’ ‘\ub9c8\uc2a4\ud130 \uc11c\ubc84\uc774\ub984’ ” ] PhpRedis: Not loaded Relay: Not loaded Predis: 2.1.1 Credis: Not loaded PHP Version: 8.0.26 Plugin Version: […]